ssdbms.ssd
Class Label

java.lang.Object
  extended byssdbms.ssd.Label

public final class Label
extends java.lang.Object

This class represents a label for a semistructured datum contained in other. Label class warp Strigs to restrict them, a label only contains word characters i.e. a to z, A to Z, 0 to 9 or _.

Author:
Egar Arturo García Cárdenas

Constructor Summary
Label(java.lang.String text)
          Creates a new label from a given String.
 
Method Summary
 int compareTo(Label label)
          Indicates wheter some label is 'equal to' this one.
 boolean equals(Label label)
          Indicates wheter some label is 'equal to' this one.
 boolean equals(java.lang.Object obj)
           
 java.lang.String getText()
          Return the text of the label.
 int hashCode()
           
 java.lang.String toString()
          Return a string representation of the label.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Label

public Label(java.lang.String text)
      throws BadLabelException
Creates a new label from a given String.

Parameters:
text - The text to be used for the label.
Throws:
BadLabelException - If text contains non word characters.
Method Detail

getText

public java.lang.String getText()
Return the text of the label.

Returns:
The text of the label.

compareTo

public int compareTo(Label label)
Indicates wheter some label is 'equal to' this one. Two labes are equals if their text is equal.

Parameters:
label - The label with which to compare.
Returns:
true if x has equal text that this one, false otherwise.

equals

public boolean equals(Label label)
Indicates wheter some label is 'equal to' this one.

Parameters:
label - The label with which to compare.
Returns:
true if label represents the same label that this one, false otherwise.

equals

public boolean equals(java.lang.Object obj)

hashCode

public int hashCode()

toString

public java.lang.String toString()
Return a string representation of the label.