ojb.broker.util.sequence
Class HighLowSequence

java.lang.Object
  |
  +--ojb.broker.util.sequence.HighLowSequence

public class HighLowSequence
extends java.lang.Object

The HighLowSequence is the persistent part of the HighLowSequenceGenerator. It makes the maximum reserved key persistently availabe.

Author:
R Bischof

Constructor Summary
HighLowSequence()
          Default constructor for the HighLowSequence object
HighLowSequence(java.lang.String className, java.lang.String fieldName, int maxKey, int grabSize)
          Constructor for the HighLowSequence object
 
Method Summary
 java.lang.String getClassName()
          Gets the className attribute of the HighLowSequence object
 java.lang.String getFieldName()
          Gets the fieldName attribute of the HighLowSequence object
 int getGrabSize()
          Gets the grabSize attribute of the HighLowSequence object
 int getMaxKey()
          Gets the maxKey attribute of the HighLowSequence object
 int getNextId()
          Gets the next key from this sequence
 void grabNextKeySet()
          Grabs the next key set, the sequence must be saved afterwards!!
 void setClassName(java.lang.String className)
          Sets the className attribute of the HighLowSequence object
 void setFieldName(java.lang.String fieldName)
          Sets the fieldName attribute of the HighLowSequence object
 void setGrabSize(int grabSize)
          Sets the grab size attribute of the HighLowSequence object
 void setMaxKey(int maxKey)
          Sets the maxKey attribute of the HighLowSequence object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HighLowSequence

public HighLowSequence()
Default constructor for the HighLowSequence object


HighLowSequence

public HighLowSequence(java.lang.String className,
                       java.lang.String fieldName,
                       int maxKey,
                       int grabSize)
Constructor for the HighLowSequence object

Parameters:
className - The classname of this sequence
fieldName - The fieldname of this sequence
maxKey - The maximum key currently in use
grabSize - The grab size, i.e. the number of keys to reserve
Method Detail

setClassName

public void setClassName(java.lang.String className)
Sets the className attribute of the HighLowSequence object

Parameters:
className - 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

setFieldName

public void setFieldName(java.lang.String fieldName)
Sets the fieldName attribute of the HighLowSequence object

Parameters:
fieldName - The new fieldName value

setMaxKey

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

Parameters:
maxKey - The new maxKey value

getClassName

public java.lang.String getClassName()
Gets the className 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

getFieldName

public java.lang.String getFieldName()
Gets the fieldName attribute of the HighLowSequence object

Returns:
The fieldName value

getNextId

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

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

getMaxKey

public int 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!!



Authors: Thomas Mahler and others. (C) 2000, 2001.
All rights reserved. Published under the Gnu Public License.
http://objectbridge.sourceforge.net
Version: 0.8.375, 2002-04-04