com.continuent.tungsten.common.patterns.order
Class Sequence

java.lang.Object
  extended by com.continuent.tungsten.common.patterns.order.Sequence
All Implemented Interfaces:
java.io.Serializable

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

See Also:
Serialized Form

Constructor Summary
Sequence()
           
Sequence(long wrapAround)
           
 
Method Summary
 void assertSameParent(Sequence sequence)
           
 Sequence clone()
           
 java.util.concurrent.atomic.AtomicLong getCurrentValue()
          Returns the currentValue value.
 long getGeneration()
          Returns the generation value.
 java.util.UUID getIdentity()
          Returns the identity value.
 java.util.concurrent.atomic.AtomicLong getLastValue()
          Returns the lastValue value.
 long getWrapAround()
          Returns the wrapAround value.
 boolean isAfter(Sequence sequence)
           
 boolean isBefore(Sequence sequence)
           
 boolean isBeforeOrEqual(Sequence sequence)
           
 boolean isEqual(Sequence sequence)
           
 boolean isWrapped()
          Returns the isWrapped value.
 void next()
           
 void reset()
           
 void setCurrentValue(java.util.concurrent.atomic.AtomicLong currentValue)
          Sets the currentValue value.
 void setGeneration(long generation)
          Sets the generation value.
 void setIdentity(java.util.UUID identity)
          Sets the identity value.
 void setLastValue(java.util.concurrent.atomic.AtomicLong lastValue)
          Sets the lastValue value.
 void setWrapAround(long wrapAround)
          Sets the wrapAround value.
 void setWrapped(boolean isWrapped)
          Sets the isWrapped value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Sequence

public Sequence(long wrapAround)

Sequence

public Sequence()
Method Detail

isBefore

public boolean isBefore(Sequence sequence)
                 throws SequenceException
Throws:
SequenceException

isBeforeOrEqual

public boolean isBeforeOrEqual(Sequence sequence)
                        throws SequenceException
Throws:
SequenceException

isAfter

public boolean isAfter(Sequence sequence)
                throws SequenceException
Throws:
SequenceException

isEqual

public boolean isEqual(Sequence sequence)
                throws SequenceException
Throws:
SequenceException

next

public void next()

clone

public Sequence clone()
Overrides:
clone in class java.lang.Object

toString

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

getWrapAround

public long getWrapAround()
Returns the wrapAround value.

Returns:
Returns the wrapAround.

setWrapAround

public void setWrapAround(long wrapAround)
Sets the wrapAround value.

Parameters:
wrapAround - The wrapAround to set.

getGeneration

public long getGeneration()
Returns the generation value.

Returns:
Returns the generation.

setGeneration

public void setGeneration(long generation)
Sets the generation value.

Parameters:
generation - The generation to set.

isWrapped

public boolean isWrapped()
Returns the isWrapped value.

Returns:
Returns the isWrapped.

setWrapped

public void setWrapped(boolean isWrapped)
Sets the isWrapped value.

Parameters:
isWrapped - The isWrapped to set.

getIdentity

public java.util.UUID getIdentity()
Returns the identity value.

Returns:
Returns the identity.

setIdentity

public void setIdentity(java.util.UUID identity)
Sets the identity value.

Parameters:
identity - The identity to set.

getCurrentValue

public java.util.concurrent.atomic.AtomicLong getCurrentValue()
Returns the currentValue value.

Returns:
Returns the currentValue.

setCurrentValue

public void setCurrentValue(java.util.concurrent.atomic.AtomicLong currentValue)
Sets the currentValue value.

Parameters:
currentValue - The currentValue to set.

getLastValue

public java.util.concurrent.atomic.AtomicLong getLastValue()
Returns the lastValue value.

Returns:
Returns the lastValue.

setLastValue

public void setLastValue(java.util.concurrent.atomic.AtomicLong lastValue)
Sets the lastValue value.

Parameters:
lastValue - The lastValue to set.

assertSameParent

public void assertSameParent(Sequence sequence)
                      throws SequenceException
Throws:
SequenceException

reset

public void reset()