com.flexive.shared
Class CustomSequencer

java.lang.Object
  extended by com.flexive.shared.CustomSequencer
All Implemented Interfaces:
java.io.Serializable

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

A user defined sequencer

Author:
Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
Serialized Form

Constructor Summary
CustomSequencer(java.lang.String name, boolean allowRollover, long currentNumber)
          Constructor
 
Method Summary
 boolean equals(java.lang.Object o)
          
 long getCurrentNumber()
          Get the current number of this sequencer, however no guarantee can be made that the next number requested will be this current number + 1
 java.lang.String getName()
          Get the unique name of this sequencer
 int hashCode()
          
 boolean isAllowRollover()
          Does this sequencer support rollover? If the current number gets close to Long.MAX_VALUE it will be reset to zero if rollover is allowed, else an exception will be thrown
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomSequencer

public CustomSequencer(java.lang.String name,
                       boolean allowRollover,
                       long currentNumber)
Constructor

Parameters:
name - unique name
allowRollover - rollover when Long.MAX_VALUE is reached?
currentNumber - the current number of the sequence (last delivered)
Method Detail

getName

public java.lang.String getName()
Get the unique name of this sequencer

Returns:
unique name of this sequencer

isAllowRollover

public boolean isAllowRollover()
Does this sequencer support rollover? If the current number gets close to Long.MAX_VALUE it will be reset to zero if rollover is allowed, else an exception will be thrown

Returns:
rollover allowed

getCurrentNumber

public long getCurrentNumber()
Get the current number of this sequencer, however no guarantee can be made that the next number requested will be this current number + 1

Returns:
current number of this sequencer

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object