org.axiondb

Class Sequence

public class Sequence extends Object implements Serializable

A database sequence. A sequence provides a mechanism for obtaining unique integer values from the database.

Note: If increment value is negative, then the sequence generator is a descending sequence generator; otherwise, it is an ascending sequence generator.

Note: The data type of a sequence generator must be exact numeric with scale 0.

Version: $Revision: 1.15 $ $Date: 2007/11/13 19:04:02 $

Author: Chuck Burdick Ahimanikya Satapathy

Field Summary
static intRADIX
Constructor Summary
Sequence()
Sequence(String name, DataType type, BigInteger startVal, BigInteger incrementBy, BigInteger maxValue, BigInteger minValue, boolean isCycle)
Create a sequence with all ANSI 2003 parameters.
Sequence(String name, int startVal)
Create a sequence starting whose initial value is startVal .
Method Summary
voidaddSequenceModificationListener(SequenceModificationListener listener)
booleanequals(Object otherobject)
Returns true iff otherobject is a Sequencewhose name are equal to mine.
Objectevaluate()
Increment and return the next value in this sequence.
ObjectgetCuurentValue()
DataTypegetDataType()
BigIntegergetIncrementBy()
BigIntegergetMaxValue()
BigIntegergetMinValue()
StringgetName()
Get the name of this sequence.
ObjectgetValue()
Get the current value of this sequence.
inthashCode()
Returns a hash code in keeping with the standard Object#equals equals/ Object#hashCode hashCodecontract.
booleanisCycle()
voidread(DataInput in)
voidwrite(DataOutput out)
Writes the given value to the given DataOutput.

Field Detail

RADIX

public static int RADIX

Constructor Detail

Sequence

public Sequence()

Sequence

public Sequence(String name, DataType type, BigInteger startVal, BigInteger incrementBy, BigInteger maxValue, BigInteger minValue, boolean isCycle)
Create a sequence with all ANSI 2003 parameters.

Sequence

public Sequence(String name, int startVal)
Create a sequence starting whose initial value is startVal .

Method Detail

addSequenceModificationListener

public void addSequenceModificationListener(SequenceModificationListener listener)

equals

public boolean equals(Object otherobject)
Returns true iff otherobject is a Sequencewhose name are equal to mine.

evaluate

public Object evaluate()
Increment and return the next value in this sequence.

getCuurentValue

public Object getCuurentValue()

getDataType

public DataType getDataType()

getIncrementBy

public BigInteger getIncrementBy()

getMaxValue

public BigInteger getMaxValue()

getMinValue

public BigInteger getMinValue()

getName

public String getName()
Get the name of this sequence.

getValue

public Object getValue()
Get the current value of this sequence.

hashCode

public int hashCode()
Returns a hash code in keeping with the standard Object#equals equals/ Object#hashCode hashCodecontract.

isCycle

public boolean isCycle()

read

public void read(DataInput in)

See Also: Sequence

write

public void write(DataOutput out)
Writes the given value to the given DataOutput.

Parameters: value the value to write, which must be Sequence