spiglet.meta
Class SpigletLabel

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

public final class SpigletLabel
extends java.lang.Object

This class represents a Label that can be used in creating a Label node in a Spiglet syntaxtree.

Author:
Santoso Wijaya

Method Summary
static SpigletLabel createLabel(java.lang.String prefix)
          Returns a unique Label object, with the given prefix.
static Label createLabelNode(SpigletLabel plabel)
          Creates and return a spiglet syntaxtree node that represents a Label.
static SpigletLabel createRawLabel(java.lang.String theLabel)
          Returns a raw Label object with the given label string.
 boolean equals(java.lang.Object obj)
           
 java.lang.String getLabel()
          Returns the string representation of this Label.
 int hashCode()
           
static void reset()
          Resets the static counter of the class' label number enumerator.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getLabel

public java.lang.String getLabel()
Returns the string representation of this Label.

Returns:
the string representation of this Label

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

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

toString

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

createLabel

public static SpigletLabel createLabel(java.lang.String prefix)
Returns a unique Label object, with the given prefix. Each subsequently created Label object has a unique number attached to the end of the given prefix, regardless of the prefix.

Parameters:
prefix - the prefix
Returns:
a unique Label object

createRawLabel

public static SpigletLabel createRawLabel(java.lang.String theLabel)
Returns a raw Label object with the given label string. No numerical suffix is involved.

Parameters:
theLabel - the label string
Returns:
the raw Label object

createLabelNode

public static Label createLabelNode(SpigletLabel plabel)
Creates and return a spiglet syntaxtree node that represents a Label.

Parameters:
plabel - the label object
Returns:
a spiglet syntaxtree node (JTB) that represents a Label

reset

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