|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.torque.om.ObjectKey org.apache.torque.om.ComboKey
public class ComboKey
This class can be used as an ObjectKey to uniquely identify an object within an application where the key consists of multiple entities (such a String[] representing a multi-column primary key).
Field Summary | |
---|---|
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. |
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. |
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)
Sets the internal representation using a ComboKey. |
void |
setValue(SimpleKey[] keys)
Sets the internal representation using a SimpleKey array. |
void |
setValue(java.lang.String keys)
Sets the internal representation using a String of the form produced by the toString method. |
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.torque.om.ObjectKey |
---|
compareTo |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final char SEPARATOR
public static final java.lang.String SEPARATOR_STRING
Constructor Detail |
---|
public ComboKey()
public ComboKey(SimpleKey[] keys)
keys
- the key valuespublic ComboKey(java.lang.String keys)
keys
- the key valuestoString()
Method Detail |
---|
public void setValue(SimpleKey[] keys)
keys
- the key valuespublic void setValue(java.lang.String keys)
setValue
in class ObjectKey
keys
- the key valuespublic void setValue(ComboKey keys)
keys
- the key valuespublic java.lang.Object getValue()
getValue
in class ObjectKey
public boolean equals(java.lang.Object keyObj)
equals
in class java.lang.Object
keyObj
- the comparison value
public boolean looseEquals(java.lang.Object keyObj)
keyObj
- the comparison value
public void appendTo(java.lang.StringBuffer sb)
ObjectKey
appendTo
in class ObjectKey
sb
- the StringBuffer to appendtoString()
public int hashCode()
hashCode
in class ObjectKey
int
valuepublic java.lang.String toString()
[type N|S|D][value][:]
.
Example: Skey1:N2:
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |