edu.mit.csail.sdg.alloy4viz
Class AlloyType

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.AlloyType
All Implemented Interfaces:
java.lang.Comparable<AlloyElement>

public final class AlloyType
extends AlloyNodeElement

Immutable; represents an Alloy toplevel signature or an Alloy subsignature.

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


Field Summary
static AlloyType INT
          This caches an instance of the "Int" AlloyType, so we don't have to keep re-constructing it.
 boolean isAbstract
          Records whether this sig is known to be "abstract"; NOTE: this value is NOT USED during equals() comparison.
 boolean isBuiltin
          Records whether this sig is known to be "builtin"; NOTE: this value is NOT USED during equals() comparison.
 boolean isEnum
          Records whether this sig is known to be "enum"; NOTE: this value is NOT USED during equals() comparison.
 boolean isMeta
          Records whether this sig is known to be "meta"; NOTE: this value is NOT USED during equals() comparison.
 boolean isOne
          Records whether this sig is known to be "one"; NOTE: this value is NOT USED during equals() comparison.
 boolean isPrivate
          Records whether this sig is known to be "private"; NOTE: this value is NOT USED during equals() comparison.
static AlloyType SEQINT
          This caches an instance of the "seq/Int" AlloyType, so we don't have to keep re-constructing it.
static AlloyType SET
          This caches an instance of the "set" AlloyType, so we don't have to keep re-constructing it.
static AlloyType STRING
          This caches an instance of the "String" AlloyType, so we don't have to keep re-constructing it.
static AlloyType UNIV
          This caches an instance of the "univ" AlloyType, so we don't have to keep re-constructing it.
 
Constructor Summary
AlloyType(java.lang.String name, boolean isOne, boolean isAbstract, boolean isBuiltin, boolean isPrivate, boolean isMeta, boolean isEnum)
          Constructs an AlloyType object with that name.
 
Method Summary
 int compareTo(AlloyElement other)
          When comparing two AlloyType objects, we compare their names.
 int compareTo(AlloyNodeElement other)
          When comparing two AlloyType objects, we compare their names.
 int compareTo(AlloyType other)
          When comparing two AlloyType objects, we compare their names.
 boolean equals(java.lang.Object other)
          Two types are equal if they have the same name.
 int hashCode()
          Compute a hash code based on the name.
 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

UNIV

public static final AlloyType UNIV
This caches an instance of the "univ" AlloyType, so we don't have to keep re-constructing it.


INT

public static final AlloyType INT
This caches an instance of the "Int" AlloyType, so we don't have to keep re-constructing it.


SEQINT

public static final AlloyType SEQINT
This caches an instance of the "seq/Int" AlloyType, so we don't have to keep re-constructing it.


STRING

public static final AlloyType STRING
This caches an instance of the "String" AlloyType, so we don't have to keep re-constructing it.


SET

public static final AlloyType SET
This caches an instance of the "set" AlloyType, so we don't have to keep re-constructing it.


isOne

public final boolean isOne
Records whether this sig is known to be "one"; NOTE: this value is NOT USED during equals() comparison.


isAbstract

public final boolean isAbstract
Records whether this sig is known to be "abstract"; NOTE: this value is NOT USED during equals() comparison.


isBuiltin

public final boolean isBuiltin
Records whether this sig is known to be "builtin"; NOTE: this value is NOT USED during equals() comparison.


isPrivate

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


isMeta

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


isEnum

public final boolean isEnum
Records whether this sig is known to be "enum"; NOTE: this value is NOT USED during equals() comparison.

Constructor Detail

AlloyType

public AlloyType(java.lang.String name,
                 boolean isOne,
                 boolean isAbstract,
                 boolean isBuiltin,
                 boolean isPrivate,
                 boolean isMeta,
                 boolean isEnum)
Constructs an AlloyType object with that name.

Method Detail

compareTo

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


compareTo

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


compareTo

public int compareTo(AlloyElement other)
When comparing two AlloyType objects, we compare their names.
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 types are equal if they have the same name.

Overrides:
equals in class java.lang.Object

hashCode

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

Overrides:
hashCode in class java.lang.Object