|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.turbine.om.ObjectKey | +--org.apache.turbine.om.ComboKey
This class can be used as an ObjectKey to uniquely identify an object within an application where the id consists of multiple entities such a String[] representing a multi-column primary key.
Field Summary | |
private static java.lang.String |
errMsg
Sets the internal representation using a String array. |
(package private) SimpleKey[] |
key
|
(package private) java.lang.StringBuffer |
sbuf
|
static char |
SEPARATOR
The single character used to separate key values in a string. |
static java.lang.String |
SEPARATOR_STRING
The single character used to separate key values in a string. |
(package private) java.util.ArrayList |
tmpKeys
|
Constructor Summary | |
ComboKey()
Creates an ComboKey whose internal representation will be set later, through a set method |
|
ComboKey(SimpleKey[] keys)
Creates a ComboKey whose internal representation is an array of SimpleKeys. |
|
ComboKey(java.lang.String keys)
Sets the internal representation to a String array. |
|
ComboKey(java.lang.String[] keys)
Creates a compound ComboKey whose internal representation is a String array. |
Method Summary | |
void |
appendTo(java.lang.StringBuffer sb)
Appends a String representation of the key to a buffer. |
boolean |
equals(java.lang.Object keyObj)
This method will return true if the conditions for a looseEquals are met and in addition no parts of the keys are null. |
java.lang.Object |
getValue()
Get the underlying object. |
int |
hashCode()
if the underlying key array is not null and the first element is not null this method returns the hashcode of the first element in the key. |
boolean |
looseEquals(java.lang.Object keyObj)
keyObj is equal to this ComboKey if keyObj is a ComboKey, String, ObjectKey[], or String[] that contains the same information this key contains. |
void |
setValue(ComboKey keys)
|
void |
setValue(SimpleKey[] keys)
Sets the internal representation using an array of SimpleKeys. |
void |
setValue(java.lang.String keys)
Sets the internal representation using a String of the form produced by the toString method. |
void |
setValue(java.lang.String[] keys)
|
java.lang.String |
toString()
A String that may consist of one section or multiple sections separated by a colon. |
Methods inherited from class org.apache.turbine.om.ObjectKey |
compareTo |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final char SEPARATOR
public static final java.lang.String SEPARATOR_STRING
java.util.ArrayList tmpKeys
java.lang.StringBuffer sbuf
SimpleKey[] key
private static java.lang.String errMsg
Constructor Detail |
public ComboKey()
public ComboKey(SimpleKey[] keys)
public ComboKey(java.lang.String[] keys) throws TurbineException
public ComboKey(java.lang.String keys) throws TurbineException
Method Detail |
public void setValue(SimpleKey[] keys)
public void setValue(java.lang.String[] keys) throws TurbineException
public void setValue(java.lang.String keys) throws TurbineException
setValue
in class ObjectKey
org.apache.turbine.om.ObjectKey
s
- a String
valueTurbineException
- if an error occurspublic void setValue(ComboKey keys)
public java.lang.Object getValue()
getValue
in class ObjectKey
public boolean equals(java.lang.Object keyObj)
equals
in class java.lang.Object
public boolean looseEquals(java.lang.Object keyObj)
public void appendTo(java.lang.StringBuffer sb)
ObjectKey
appendTo
in class ObjectKey
org.apache.turbine.om.ObjectKey
sb
- a StringBuffer
public int hashCode()
hashCode
in class ObjectKey
int
valuepublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |