|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.triactive.jdo.store.OID
An object identifier. OIDs are normally used as object identifiers for persistent objects that use data store identity. They're also used for view objects, which actually use non-data store identity.
An OID is effectively a long containing a value in the range 0 to 260-1. The 60 bits encode three unsigned integer ID values; a 15-bit class ID value, a 30-bit object ID high value, and a 15-bit object ID low value.
The object ID value is separated into two parts to facilitate the use of a particular strategy for efficiently generating unique OID values, called the high/low approach. In this approach, the high value is obtained from a persistent store, and the low value is assigned locally by the application. The advantage is performance; it avoids the bottleneck of hitting the persistent store every time an ID needs to be generated.
StoreManager
,
Serialized FormField Summary | |
static int |
MAX_CLASSID
The maximum class ID value. |
static int |
MAX_LENGTH
The maximum length of an OID in string form. |
static int |
MAX_OBJIDHI
The maximum hi portion of an object ID value. |
static int |
MAX_OBJIDLO
The maximum lo portion of an object ID value. |
static long |
MAX_VALUE
The maximum value of an OID as a long. |
Constructor Summary | |
OID(int classID,
int objIDHi,
int objIDLo)
Constructs an OID from three integer values. |
|
OID(long value)
Constructs an OID from its long value. |
|
OID(java.lang.String s)
Constructs an OID from its string representation. |
Method Summary | |
boolean |
equals(java.lang.Object obj)
|
int |
getClassID()
Returns the class ID portion of the OID. |
int |
hashCode()
|
long |
longValue()
Returns the value of this OID as a long value. |
java.lang.String |
toString()
Returns the string representation of the OID. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final long MAX_VALUE
public static final int MAX_CLASSID
public static final int MAX_OBJIDHI
public static final int MAX_OBJIDLO
public static final int MAX_LENGTH
Constructor Detail |
public OID(long value) throws java.lang.IllegalArgumentException
value
- the long value of the OID.
java.lang.IllegalArgumentException
- if the argument is not in the range 0 to MAX_VALUE
.public OID(int classID, int objIDHi, int objIDLo) throws java.lang.IllegalArgumentException
MAX_CLASSID
,
MAX_OBJIDHI
, and MAX_OBJIDLO
.
classID
- the class ID value.objIDHi
- the hi portion of the object ID value.objIDLo
- the lo portion of the object ID value.
java.lang.IllegalArgumentException
- if one of the arguments is out of range.public OID(java.lang.String s) throws java.lang.IllegalArgumentException
s
- the string representation of an OID.
java.lang.IllegalArgumentException
- if the given string representation is not valid.toString()
Method Detail |
public int getClassID()
public long longValue()
public boolean equals(java.lang.Object obj)
public int hashCode()
public java.lang.String toString()
ccc-hhhhhh-lll
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |