org.marketcetera.ors
Class LongIDFactory

java.lang.Object
  extended by org.marketcetera.ors.LongIDFactory

public class LongIDFactory
extends Object

A long ID factory. It relies on a block factory to assign blocks, and then locally assigns IDs within that block. The block factory must generate numeric IDs.

Since:
2.1.0
Version:
$Id: LongIDFactory.java 16154 2012-07-14 16:34:05Z colin $
Author:
tlerios@marketcetera.com

Field Summary
static long LOCAL_ID_COUNT
          The count of local IDs assigned per block.
 
Constructor Summary
LongIDFactory(IDFactory blockFactory)
          Creates a new long ID factory that relies on the given block factory, which must generate numeric IDs.
 
Method Summary
 IDFactory getBlockFactory()
          Returns the receiver's block factory.
 long getNext()
          Gets the next ID from the receiver.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCAL_ID_COUNT

public static final long LOCAL_ID_COUNT
The count of local IDs assigned per block.

See Also:
Constant Field Values
Constructor Detail

LongIDFactory

public LongIDFactory(IDFactory blockFactory)
Creates a new long ID factory that relies on the given block factory, which must generate numeric IDs.

Parameters:
blockFactory - The block factory.
Method Detail

getBlockFactory

public IDFactory getBlockFactory()
Returns the receiver's block factory.

Returns:
The factory.

getNext

public long getNext()
             throws NoMoreIDsException
Gets the next ID from the receiver.

Returns:
The ID.
Throws:
NoMoreIDsException - Thrown if retrieval fails.


Copyright © 2012. All Rights Reserved.