add more, GlobalConstruct parsed
[cdsspec-compiler.git] / src / edu / uci / eecs / specCompiler / specExtraction / ConditionalInterface.java
1 package edu.uci.eecs.specCompiler.specExtraction;
2
3 public class ConditionalInterface {
4         public final String interfaceName;
5         public final String hbConditionLabel;
6         
7         public ConditionalInterface(String interfaceName, String hbConditionLabel) {
8                 this.interfaceName = interfaceName;
9                 this.hbConditionLabel = hbConditionLabel;
10         }
11         
12         public boolean equals(ConditionalInterface other) {
13                 if (!(other instanceof ConditionalInterface))
14                         return false;
15                 ConditionalInterface another = (ConditionalInterface) other;
16                 return another.interfaceName.equals(interfaceName) && 
17                                 another.hbConditionLabel.equals(hbConditionLabel);
18         }
19         
20         public int hashCode() {
21                 return interfaceName.hashCode() << 5 ^ hbConditionLabel.hashCode();
22         }
23         
24         public String toString() {
25                 if (hbConditionLabel.equals(""))
26                         return interfaceName + "(true)";
27                 else
28                         return interfaceName + "(" + hbConditionLabel + ")";
29         }
30 }