org.apache.ojb.broker.util.sequence
Class HighLowSequence

java.lang.Object
  extended by org.apache.ojb.broker.util.sequence.HighLowSequence
All Implemented Interfaces:
java.io.Serializable

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

The HighLowSequence is the persistent part of the SequenceManagerHighLowImpl. It makes the maximum reserved key persistently available.

Version:
$Id: HighLowSequence.java 365232 2005-12-21 22:36:07Z tomdz $
See Also:
Serialized Form

Constructor Summary
HighLowSequence()
          Default constructor for the HighLowSequence object
HighLowSequence(java.lang.String tableName, long maxKey, int grabSize, java.lang.Integer version)
           
 
Method Summary
 HighLowSequence getCopy()
           
 int getGrabSize()
          Gets the grabSize attribute of the HighLowSequence object
 long getMaxKey()
          Gets the maxKey attribute of the HighLowSequence object
 java.lang.String getName()
          Gets the name attribute of the HighLowSequence object
 long getNextId()
          Gets the next key from this sequence
 java.lang.Integer getVersion()
           
 void grabNextKeySet()
          Grabs the next key set, the sequence must be saved afterwards!!
 void setGrabSize(int grabSize)
          Sets the grab size attribute of the HighLowSequence object
 void setMaxKey(long maxKey)
          Sets the maxKey attribute of the HighLowSequence object
 void setName(java.lang.String name)
          Sets the name attribute of the HighLowSequence object
 void setVersion(java.lang.Integer version)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HighLowSequence

public HighLowSequence()
Default constructor for the HighLowSequence object


HighLowSequence

public HighLowSequence(java.lang.String tableName,
                       long maxKey,
                       int grabSize,
                       java.lang.Integer version)
Method Detail

getCopy

public HighLowSequence getCopy()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getVersion

public java.lang.Integer getVersion()

setVersion

public void setVersion(java.lang.Integer version)

setName

public void setName(java.lang.String name)
Sets the name attribute of the HighLowSequence object

Parameters:
name - The new className value

setGrabSize

public void setGrabSize(int grabSize)
Sets the grab size attribute of the HighLowSequence object

Parameters:
grabSize - The new grabSize value

setMaxKey

public void setMaxKey(long maxKey)
Sets the maxKey attribute of the HighLowSequence object

Parameters:
maxKey - The new maxKey value

getName

public java.lang.String getName()
Gets the name attribute of the HighLowSequence object

Returns:
The className value

getGrabSize

public int getGrabSize()
Gets the grabSize attribute of the HighLowSequence object

Returns:
The grabSize value

getNextId

public long getNextId()
Gets the next key from this sequence

Returns:
The next key or 0 if sequence needs to grab new keyset

getMaxKey

public long getMaxKey()
Gets the maxKey attribute of the HighLowSequence object

Returns:
The maxKey value

grabNextKeySet

public void grabNextKeySet()
Grabs the next key set, the sequence must be saved afterwards!!



(C) 2002 - 2006 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30