Module org.eclipse.persistence.core
Class CacheId
- java.lang.Object
-
- org.eclipse.persistence.internal.identitymaps.CacheId
-
- All Implemented Interfaces:
Serializable,Comparable<CacheId>
public class CacheId extends Object implements Serializable, Comparable<CacheId>
Defines a wrapper for a primary key (Id) to use as a key in the cache.- Since:
- EclipseLink 2.1
- Author:
- James Sutherland
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Object value)Append the value to the end of the primary key values.intcompareTo(CacheId otherId)Determine if the receiver is greater or less than the key.protected intcomputeHash(Object[] primaryKey)Pre-compute the hash to optimize hash calls.booleanequals(Object object)Determine if the receiver is equal to anObject.booleanequals(CacheId id)Determine if the receiver is equal to key.Object[]getPrimaryKey()booleanhasArray()inthashCode()Return the precomputed hashcode.voidset(int index, Object value)Set the value in the primary key values.voidsetPrimaryKey(Object[] primaryKey)StringtoString()
-
-
-
Constructor Detail
-
CacheId
public CacheId()
-
CacheId
public CacheId(Object[] primaryKey)
-
-
Method Detail
-
getPrimaryKey
public Object[] getPrimaryKey()
-
setPrimaryKey
public void setPrimaryKey(Object[] primaryKey)
-
add
public void add(Object value)
Append the value to the end of the primary key values.
-
set
public void set(int index, Object value)Set the value in the primary key values.
-
computeHash
protected int computeHash(Object[] primaryKey)
Pre-compute the hash to optimize hash calls.
-
equals
public boolean equals(Object object)
Determine if the receiver is equal to anObject. If anObject is a CacheKey, do further comparison, otherwise, return false.- Overrides:
equalsin classObject- See Also:
CacheKey.equals(CacheKey)
-
equals
public boolean equals(CacheId id)
Determine if the receiver is equal to key. Use an index compare, because it is much faster than enumerations.
-
compareTo
public int compareTo(CacheId otherId)
Determine if the receiver is greater or less than the key.- Specified by:
compareToin interfaceComparable<CacheId>
-
hasArray
public boolean hasArray()
-
-