|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mobicents.protocols.smpp.util.DefaultSequenceScheme
public class DefaultSequenceScheme
The default sequence numbering scheme. This implementation starts at sequence
number 1 and increments by 1 for each number requested, resulting in the
sequence numbers 1..2..3..4..5..6..7..8..n. If the sequence
number reaches as far as Integer.MAX_VALUE, it will wrap back
around to 1.
This implementation uses an AtomicInteger
internally to track the next sequence number.
| Field Summary | |
|---|---|
static long |
MAX_VALUE
Maximum this sequence can go to (a 32-bit unsigned integer). |
| Fields inherited from interface org.mobicents.protocols.smpp.util.SequenceNumberScheme |
|---|
PEEK_UNSUPPORTED |
| Constructor Summary | |
|---|---|
DefaultSequenceScheme()
|
|
DefaultSequenceScheme(long start)
Construct a new DefaultSequenceScheme that starts the sequence from start. |
|
| Method Summary | |
|---|---|
long |
nextNumber()
Get the next number in this sequence's scheme. |
long |
peek()
Get the next number in this sequence's scheme without causing it to move to the next-in-sequence. |
long |
peek(long nth)
Get the nth next number in this sequence's scheme without causing it to move to the next-in-sequence. |
void |
reset()
Reset the sequence scheme to the beginning of the sequence. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long MAX_VALUE
| Constructor Detail |
|---|
public DefaultSequenceScheme()
public DefaultSequenceScheme(long start)
start.
| Method Detail |
|---|
public long nextNumber()
SequenceNumberScheme
nextNumber in interface SequenceNumberSchemepublic long peek()
SequenceNumberSchemenextNumber without actually
increasing the sequence. Multiple calls to peek will
return the same number until a call to nextNumber is made.
peek in interface SequenceNumberSchemepublic long peek(long nth)
SequenceNumberSchementh
next number in the sequence. This is an optional operation. If a sequence
numbering scheme does not support this operation, it should always return
SequenceNumberScheme.PEEK_UNSUPPORTED to the caller.
peek in interface SequenceNumberSchemepublic void reset()
SequenceNumberScheme
reset in interface SequenceNumberScheme
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||