com.metamatrix.common.id.dbid
Class ReservedIDBlock

java.lang.Object
  extended by com.metamatrix.common.id.dbid.ReservedIDBlock
All Implemented Interfaces:
java.io.Serializable

public class ReservedIDBlock
extends java.lang.Object
implements java.io.Serializable

Used by DBIDGenerator to reserve a block of uniqueIDs used to create ID objects.

See Also:
Serialized Form

Field Summary
static long NO_ID_AVAILABLE
          Indicates that all the id's have been used up for this block
 
Constructor Summary
ReservedIDBlock()
          Construct a new instance with the first ID and last ID in the block.
 
Method Summary
 long getNextID()
          Return the next ID in the block.
 void setBlockValues(long first, long max)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_ID_AVAILABLE

public static final long NO_ID_AVAILABLE
Indicates that all the id's have been used up for this block

See Also:
Constant Field Values
Constructor Detail

ReservedIDBlock

public ReservedIDBlock()
Construct a new instance with the first ID and last ID in the block.

Parameters:
first - Defines the first id in this block.
last - Defines the last id in the block.
Throws:
java.lang.IllegalArgumentException - if first > last
Method Detail

setBlockValues

public void setBlockValues(long first,
                           long max)

getNextID

public long getNextID()
Return the next ID in the block. If no id is available then return NO_ID_AVAILABLE

Returns:
long nextID in block


Copyright © 2009. All Rights Reserved.