gov.sandia.cognition.framework
Class DefaultSemanticLabel

java.lang.Object
  extended by gov.sandia.cognition.framework.DefaultSemanticLabel
All Implemented Interfaces:
SemanticLabel, Serializable, Comparable<DefaultSemanticLabel>

public class DefaultSemanticLabel
extends Object
implements SemanticLabel, Comparable<DefaultSemanticLabel>, Serializable

This class implements a semantic label using a string.

Since:
1.0
Author:
Justin Basilico, Kevin R. Dixon
See Also:
Serialized Form

Constructor Summary
DefaultSemanticLabel(String label)
          Creates a new DefaultSemanticLabel.
 
Method Summary
 int compareTo(DefaultSemanticLabel other)
          Takes a label and compares that label to this one.
 boolean equals(DefaultSemanticLabel other)
          Determines is this DefaultSemanticLabel is equal to the given one.
 boolean equals(Object other)
          Determines if this label is equal to a given object.
 String getLabel()
          Getter for label.
 String getName()
          Gets the name of the label, which is its String.
 int hashCode()
          Computes the hash-code for the label, which is just the hash-code for its String.
 String toString()
          The name of the label.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultSemanticLabel

public DefaultSemanticLabel(String label)
Creates a new DefaultSemanticLabel.

Parameters:
label - The String for the label.
Method Detail

toString

public String toString()
The name of the label.

Overrides:
toString in class Object
Returns:
The name of the label.

getName

public String getName()
Gets the name of the label, which is its String.

Specified by:
getName in interface SemanticLabel
Returns:
The name of the label

hashCode

public int hashCode()
Computes the hash-code for the label, which is just the hash-code for its String.

Specified by:
hashCode in interface SemanticLabel
Overrides:
hashCode in class Object
Returns:
The hash-code for the label

equals

public boolean equals(Object other)
Determines if this label is equal to a given object.

Specified by:
equals in interface SemanticLabel
Overrides:
equals in class Object
Parameters:
other - The object to compare to
Returns:
True if the objects are equal and false otherwise

equals

public boolean equals(DefaultSemanticLabel other)
Determines is this DefaultSemanticLabel is equal to the given one.

Parameters:
other - The other DefaultSemanticLabel to compare to
Returns:
True if the labels are equal and false otherwise

compareTo

public int compareTo(DefaultSemanticLabel other)
Takes a label and compares that label to this one.

Specified by:
compareTo in interface Comparable<DefaultSemanticLabel>
Parameters:
other - The label to compare with.
Returns:
The comparison.

getLabel

public String getLabel()
Getter for label.

Returns:
The String label.