Exemplo n.º 1
0
 @Override
 public int hashCode() {
   if (hashCache != null) return hashCache;
   int result = super.hashCode();
   final int prime = 31;
   result = (prime * result) + ((type == null) ? 0 : type.hashCode());
   hashCache = result;
   return result;
 }
Exemplo n.º 2
0
 @Override
 public boolean equals(Object obj) {
   if (this == obj) return true;
   if (obj == null) return false;
   if (!(obj instanceof AbstractHDLEqualityOp)) return false;
   if (!super.equals(obj)) return false;
   final AbstractHDLEqualityOp other = (AbstractHDLEqualityOp) obj;
   if (type == null) {
     if (other.type != null) return false;
   } else if (!type.equals(other.type)) return false;
   return true;
 }
Exemplo n.º 3
0
 @Override
 public String toConstructionString(String spacing) {
   final boolean first = true;
   final StringBuilder sb = new StringBuilder();
   sb.append('\n').append(spacing).append("new HDLEqualityOp()");
   if (left != null) {
     sb.append(".setLeft(").append(left.toConstructionString(spacing + "\t")).append(")");
   }
   if (right != null) {
     sb.append(".setRight(").append(right.toConstructionString(spacing + "\t")).append(")");
   }
   if (type != null) {
     sb.append("\n")
         .append(spacing + "\t")
         .append(".setType(HDLEqualityOpType.")
         .append(type.name() + ")");
   }
   return sb.toString();
 }