org.apache.turbine.om
Class ObjectKey
java.lang.Object
|
+--org.apache.turbine.om.ObjectKey
- All Implemented Interfaces:
- java.lang.Comparable, java.io.Serializable
- Direct Known Subclasses:
- ComboKey, SimpleKey
- public abstract class ObjectKey
- extends java.lang.Object
- implements java.io.Serializable, java.lang.Comparable
This class can be used to uniquely identify an object within
an application. There are four subclasses: StringKey, NumberKey,
and DateKey, and ComboKey which is a Key made up of a combination
ofthe first three.
- See Also:
- Serialized Form
Field Summary |
protected java.lang.Object |
key
The underlying key value. |
Constructor Summary |
protected |
ObjectKey()
Initializes the internal key value to null . |
Method Summary |
void |
appendTo(java.lang.StringBuffer sb)
Appends a String representation of the key to a buffer. |
int |
compareTo(java.lang.Object obj)
Implements the compareTo method. |
java.lang.Object |
getValue()
Get the underlying object. |
int |
hashCode()
Returns the hashcode of the underlying value (key), if key is
not null. |
abstract void |
setValue(java.lang.String s)
Reset the underlying object using a String. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, notify, notifyAll, registerNatives, toString, wait, wait, wait |
key
protected java.lang.Object key
- The underlying key value.
ObjectKey
protected ObjectKey()
- Initializes the internal key value to
null
.
hashCode
public int hashCode()
- Returns the hashcode of the underlying value (key), if key is
not null. Otherwise calls Object.hashCode()
- Overrides:
hashCode
in class java.lang.Object
- Returns:
- an
int
value
getValue
public java.lang.Object getValue()
- Get the underlying object.
appendTo
public void appendTo(java.lang.StringBuffer sb)
- Appends a String representation of the key to a buffer.
- Parameters:
sb
- a StringBuffer
compareTo
public int compareTo(java.lang.Object obj)
- Implements the compareTo method.
- Specified by:
compareTo
in interface java.lang.Comparable
- Parameters:
obj
- the object to compare to this object
setValue
public abstract void setValue(java.lang.String s)
throws TurbineException
- Reset the underlying object using a String.
- Parameters:
s
- a String
value- Throws:
TurbineException
- if an error occurs
Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.