spiglet.meta
Class SpigletTemp

java.lang.Object
  extended by spiglet.meta.SpigletTemp

public final class SpigletTemp
extends java.lang.Object

This class represents a Temp object (immutable) that can be used in the creation of spiglet syntaxtree node.

Author:
Santoso Wijaya

Method Summary
static SpigletTemp createRawTemp(int ord)
          Returns a Temp object with the user-specified ordinal number
static SpigletTemp createTemp()
          Returns a unique Temp object.
static Temp createTempNode(SpigletTemp temp)
          Creates and return a spiglet syntaxtree node that represents a Temp.
 boolean equals(java.lang.Object obj)
          Returns true if the specified object is also a SpigletTemp, and the two have the same ordinal number.
 int getOrdinal()
          Returns this Temp's register number.
 int hashCode()
           
static void reset()
          Resets the static counter of the class' Temp number enumerator.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getOrdinal

public int getOrdinal()
Returns this Temp's register number.

Returns:
this Temp's register number

equals

public boolean equals(java.lang.Object obj)
Returns true if the specified object is also a SpigletTemp, and the two have the same ordinal number.

Overrides:
equals in class java.lang.Object
Parameters:
obj - object to be compared for equality with this Temp
Returns:
true if the specified object is equal to this Temp

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

createRawTemp

public static SpigletTemp createRawTemp(int ord)
Returns a Temp object with the user-specified ordinal number

Parameters:
ord - the ordinal
Returns:
a Temp object with the given ordinal

createTemp

public static SpigletTemp createTemp()
Returns a unique Temp object. Each subsequently created Temp object gets an ordinal number that is one higher than the previously created Temp object.

Returns:
a new Temp object

createTempNode

public static Temp createTempNode(SpigletTemp temp)
Creates and return a spiglet syntaxtree node that represents a Temp.

Parameters:
temp - the Temp object
Returns:
a spiglet syntaxtree node (JTB) that represents a Temp

reset

public static void reset()
Resets the static counter of the class' Temp number enumerator.