Exemplo n.º 1
0
 /* (non-Javadoc)
  * @see java.lang.Object#equals(java.lang.Object)
  * Returns true if the IDs and values are equal. Values can be unassigned, but then both have to be unassigned
  */
 public boolean equals(Object to) {
   if (to != null && to instanceof Assignment) {
     Assignment other = (Assignment) to;
     if (variableId.equals(other.getVariableId()))
       if ((value == null && other.getValue() == null) || value.equals(other.getValue()))
         return true;
   }
   return false;
 }
Exemplo n.º 2
0
 /**
  * @param arg0
  * @return a comparison of the IDs of the variables (values are ignored)
  */
 public int compareTo(Object arg0) {
   Assignment new_name = (Assignment) arg0;
   int vidcmp = variableId.compareTo(new_name.getVariableId());
   if (vidcmp == 0) return value.compareTo(new_name.value);
   else return vidcmp;
 }