|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jgroups.util.SeqnoList
public class SeqnoList
A list of sequence numbers (seqnos). Seqnos have to be added in ascending order, and can be single seqnos or seqno ranges (e.g. [5-10]). This class is unsynchronized. Note that for serialization, we assume that the lowest and highest seqno in the list are not more than 2 ^ 31 apart.
Nested Class Summary | |
---|---|
protected static class |
SeqnoList.Seqno
|
protected class |
SeqnoList.SeqnoListIterator
|
protected static class |
SeqnoList.SeqnoRange
|
Field Summary | |
---|---|
protected java.util.List<SeqnoList.Seqno> |
seqnos
|
Constructor Summary | |
---|---|
SeqnoList()
|
|
SeqnoList(long seqno)
|
|
SeqnoList(long from,
long to)
|
Method Summary | |
---|---|
SeqnoList |
add(long... seqnos)
|
SeqnoList |
add(long seqno)
Adds a single seqno |
SeqnoList |
add(long from,
long to)
Adds a seqno range |
long |
getLast()
Returns the last seqno, this should also be the highest seqno in the list as we're supposed to add seqnos in order |
java.util.Iterator<java.lang.Long> |
iterator()
|
void |
readFrom(java.io.DataInput in)
Read the state of the current object (including superclasses) from instream Note that the input stream must not be closed |
void |
remove(long min_seqno)
Removes all seqnos <= seqno |
void |
removeHigherThan(long max_seqno)
Removes all seqnos > seqno |
int |
serializedSize()
|
int |
size()
|
java.lang.String |
toString()
|
void |
writeTo(java.io.DataOutput out)
Write the entire state of the current object (including superclasses) to outstream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final java.util.List<SeqnoList.Seqno> seqnos
Constructor Detail |
---|
public SeqnoList()
public SeqnoList(long seqno)
public SeqnoList(long from, long to)
Method Detail |
---|
public SeqnoList add(long seqno)
public SeqnoList add(long... seqnos)
public SeqnoList add(long from, long to)
public void remove(long min_seqno)
public void removeHigherThan(long max_seqno)
public long getLast()
public void writeTo(java.io.DataOutput out) throws java.lang.Exception
Streamable
writeTo
in interface Streamable
java.lang.Exception
public void readFrom(java.io.DataInput in) throws java.lang.Exception
Streamable
readFrom
in interface Streamable
java.lang.Exception
public int serializedSize()
public int size()
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Iterator<java.lang.Long> iterator()
iterator
in interface java.lang.Iterable<java.lang.Long>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |