com.triactive.jdo.store
Class OIDGenerator

java.lang.Object
  extended bycom.triactive.jdo.store.OIDGenerator
Direct Known Subclasses:
DatastoreOIDGenerator, NondurableOIDGenerator

public abstract class OIDGenerator
extends java.lang.Object

Generates OIDs for a single class of objects.

Author:
Mike Martin

Field Summary
protected  short classId
          The class ID of OIDs to generate.
protected  int nextHiValue
          The hi value of the next OID to be returned.
protected  short nextLoValue
          The lo value of the next OID to be returned.
 
Constructor Summary
OIDGenerator(int classId)
          Constructs a new OID generator.
 
Method Summary
 OID maximum()
          Returns the highest possible OID value for the class of OIDs returned by this generator.
 OID minimum()
          Returns the lowest possible OID value for the class of OIDs returned by this generator.
abstract  OID next(StoreManager storeMgr)
          Generates the next unique OID value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classId

protected final short classId
The class ID of OIDs to generate.


nextHiValue

protected int nextHiValue
The hi value of the next OID to be returned.


nextLoValue

protected short nextLoValue
The lo value of the next OID to be returned.

Constructor Detail

OIDGenerator

public OIDGenerator(int classId)
Constructs a new OID generator.

Parameters:
classId - the class ID of OIDs to generate.
Method Detail

minimum

public final OID minimum()
Returns the lowest possible OID value for the class of OIDs returned by this generator.


maximum

public final OID maximum()
Returns the highest possible OID value for the class of OIDs returned by this generator.


next

public abstract OID next(StoreManager storeMgr)
                  throws OIDOverflowException
Generates the next unique OID value.

Parameters:
storeMgr - the store manager to use for accessing datastore-based sequence(s), if necessary.
Returns:
the next unique OID
Throws:
OIDOverflowException - if the generator can produce no more values


Copyright 2001-2007 The TJDO Project All Rights Reserved.