org.quattor.pan.utils
Interface Term

All Superinterfaces:
Comparable<Term>
All Known Implementing Classes:
LongProperty, StringProperty

public interface Term
extends Comparable<Term>

This interface provides the methods path Term objects must implement.

Author:
loomis

Method Summary
 boolean equals(Object term)
          Term objects may be used in hashes and should provide an efficient equals method.
 Integer getIndex()
          Method to extract the Integer index for this Term.
 String getKey()
          Method to extract the String key for this Term.
 int hashCode()
          Term objects may be used in nlists.
 boolean isKey()
          A utility function to determine if this Term is a key (String value).
 String toString()
          This method must return a String representation of the Term object.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

isKey

boolean isKey()
A utility function to determine if this Term is a key (String value).

Returns:
boolean indicating if this Term is a key

getIndex

Integer getIndex()
                 throws InvalidTermException
Method to extract the Integer index for this Term. This will throw an exception if the Term is not an index.

Returns:
Integer index of the Term
Throws:
InvalidTermException - thrown if the term is not an index; message should contain the string value of the term that was used

getKey

String getKey()
              throws InvalidTermException
Method to extract the String key for this Term. This will throw an exception if the Term is not a key.

Returns:
String key of the Term
Throws:
InvalidTermException - thrown if the term is not a key; message should contain the string value of the term that was used

hashCode

int hashCode()
Term objects may be used in nlists. Consequently, implementations should provide a highly-efficient hashCode method.

Overrides:
hashCode in class Object
Returns:
hash code for this Term

equals

boolean equals(Object term)
Term objects may be used in hashes and should provide an efficient equals method.

Overrides:
equals in class Object
Returns:
boolean indicating whether two objects are equal

toString

String toString()
This method must return a String representation of the Term object. It must be exactly the same String which would be returned by the underlying value.

Overrides:
toString in class Object


Copyright © 2012 Quattor. All Rights Reserved.