org.quattor.pan.utils
Interface Term

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

public interface Term
extends java.lang.Comparable<Term>

This interface provides the methods path Term objects must implement.

Author:
loomis

Method Summary
 boolean equals(java.lang.Object term)
          Term objects may be used in hashes and should provide an efficient equals method.
 java.lang.Integer getIndex()
          Method to extract the Integer index for this Term.
 java.lang.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).
 java.lang.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

java.lang.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

java.lang.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 java.lang.Object
Returns:
hash code for this Term

equals

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

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

toString

java.lang.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 java.lang.Object


Copyright © 2011 Quattor. All Rights Reserved.