kanga.meta
Class KangaLabel

java.lang.Object
  extended by kanga.meta.KangaLabel

public final class KangaLabel
extends java.lang.Object

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

Author:
Santoso Wijaya

Method Summary
static KangaLabel createLabel(java.lang.String prefix)
          Returns a unique Label object, with the given prefix.
static Label createLabelNode(KangaLabel plabel)
          Creates and return a Kanga syntaxtree node that represents a Label.
static KangaLabel 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 KangaLabel 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 KangaLabel 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(KangaLabel plabel)
Creates and return a Kanga syntaxtree node that represents a Label.

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

reset

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