edu.mit.csail.sdg.alloy4viz
Class AlloySet

java.lang.Object
  extended by edu.mit.csail.sdg.alloy4viz.AlloyElement
      extended by edu.mit.csail.sdg.alloy4viz.AlloyNodeElement
          extended by edu.mit.csail.sdg.alloy4viz.AlloySet
All Implemented Interfaces:
java.lang.Comparable<AlloyElement>

public final class AlloySet
extends AlloyNodeElement

Immutable; represents an Alloy set in an instance.

Thread Safety: Can be called only by the AWT event thread.


Field Summary
 boolean isMeta
          Records whether this relation is known to be "meta"; NOTE: this value is NOT USED during equals() comparison.
 boolean isPrivate
          Records whether this relation is known to be "private"; NOTE: this value is NOT USED during equals() comparison.
 
Constructor Summary
AlloySet(java.lang.String name, boolean isPrivate, boolean isMeta, AlloyType type)
          Constructs a new AlloySet object.
 
Method Summary
 int compareTo(AlloyElement other)
          When comparing two AlloySet objects, we first compare their names, then their types.
 int compareTo(AlloyNodeElement other)
          When comparing two AlloySet objects, we first compare their names, then their types.
 int compareTo(AlloySet other)
          When comparing two AlloySet objects, we first compare their names, then their types.
 boolean equals(java.lang.Object other)
          Two sets are equal if they have the same name and the same type.
 AlloyType getType()
          Returns the parent type of the AlloySet.
 int hashCode()
          Compute a hash code based on the name and the type.
 java.lang.String toString()
          This value is used to display this type in the Visualizer's customization screen.
 
Methods inherited from class edu.mit.csail.sdg.alloy4viz.AlloyElement
getName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

isPrivate

public final boolean isPrivate
Records whether this relation is known to be "private"; NOTE: this value is NOT USED during equals() comparison.


isMeta

public final boolean isMeta
Records whether this relation is known to be "meta"; NOTE: this value is NOT USED during equals() comparison.

Constructor Detail

AlloySet

public AlloySet(java.lang.String name,
                boolean isPrivate,
                boolean isMeta,
                AlloyType type)
Constructs a new AlloySet object.

Method Detail

getType

public AlloyType getType()
Returns the parent type of the AlloySet.


compareTo

public int compareTo(AlloySet other)
When comparing two AlloySet objects, we first compare their names, then their types.
We guarantee x.equals(y) iff x.compareTo(y)==0


compareTo

public int compareTo(AlloyNodeElement other)
When comparing two AlloySet objects, we first compare their names, then their types.
We guarantee x.equals(y) iff x.compareTo(y)==0


compareTo

public int compareTo(AlloyElement other)
When comparing two AlloySet objects, we first compare their names, then their types.
We guarantee x.equals(y) iff x.compareTo(y)==0


toString

public java.lang.String toString()
This value is used to display this type in the Visualizer's customization screen.

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object other)
Two sets are equal if they have the same name and the same type.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Compute a hash code based on the name and the type.

Overrides:
hashCode in class java.lang.Object