public class CompoundKey extends java.lang.Object implements XCloneable, java.lang.Comparable, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected java.lang.Comparable[] |
keyValues
Object array of key values.
|
Constructor and Description |
---|
CompoundKey(java.lang.Comparable row)
Create a CompoundKey with one value.
|
CompoundKey(java.lang.Comparable[] keyValues)
Create a CompoundKey.
|
CompoundKey(java.lang.Comparable row,
java.lang.Comparable column)
Create a CompoundKey with two values.
|
CompoundKey(java.lang.Comparable row,
java.lang.Comparable column,
java.lang.Comparable slice)
Create a CompoundKey with two values.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Return a shallow cloned copy of this object.
|
int |
compareTo(java.lang.Object object)
Compare this key with another.
|
boolean |
equals(java.lang.Object object)
Check if another object is equal to this one.
|
java.lang.Comparable[] |
getKeyValues()
Get key values.
|
int |
hashCode()
Get the hash code of the keys.
|
java.lang.String |
toString()
Return a string representation of this object.
|
protected final java.lang.Comparable[] keyValues
The key value is declared final because its values should not be changed once it is defined.
public CompoundKey(java.lang.Comparable[] keyValues)
keyValues
- Values of the key as an array.
Each key value must implement the comparable interface.
public CompoundKey(java.lang.Comparable row)
row
- "Row" value.public CompoundKey(java.lang.Comparable row, java.lang.Comparable column)
row
- "Row" value.column
- "Column" value.public CompoundKey(java.lang.Comparable row, java.lang.Comparable column, java.lang.Comparable slice)
row
- "Row" value.column
- "Column" value.slice
- "Slice" value.public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- Other object to test for equality.public int compareTo(java.lang.Object object)
compareTo
in interface java.lang.Comparable
object
- The other CompoundKey.We use compareTo on the array entries in the key. This may not give the desired result if the array entries are themselves arrays.
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Comparable[] getKeyValues()
public java.lang.Object clone()
clone
in interface XCloneable
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- which should never happen.