| java.lang.Object org.cougaar.core.blackboard.AckSet
AckSet | class AckSet implements Serializable(Code) | | A bit set for keeping track of sequence numbers, used by
the
MessageManager .
This is similar to a BitSet, but has a shifting base index. The
position of the first zero bit in the set can be queried and the
representation shifted so that the one bits prior to that first
zero don't require storage.
|
Constructor Summary | |
public | AckSet() Construct with sequence numbers starting at zero. | public | AckSet(int initialSequenceNumber) Construct with sequence numbers starting at a specified position.
Parameters: initialSequenceNumber - the position of the first zero inthe bit set. |
Method Summary | |
public synchronized int | advance() Find the first zero in the bitset, advance minSequence to that
position, and return that sequence number. | public int | getMinSequence() Get the current minSequence value. | public boolean | isSet(int sequenceNumber) Test if a particular bit is set.
Parameters: sequenceNumber - the bit to test. | public synchronized void | set(int sequenceNumber) Set the bit corresponding to a particular sequence number. | public String | toString() |
AckSet | public AckSet()(Code) | | Construct with sequence numbers starting at zero.
|
AckSet | public AckSet(int initialSequenceNumber)(Code) | | Construct with sequence numbers starting at a specified position.
Parameters: initialSequenceNumber - the position of the first zero inthe bit set. |
advance | public synchronized int advance()(Code) | | Find the first zero in the bitset, advance minSequence to that
position, and return that sequence number.
the position of the first bit that has not be set. |
getMinSequence | public int getMinSequence()(Code) | | Get the current minSequence value. This is always the same as the
last value returned from advance.
the position of first zero in the set as of the last callto advance. |
isSet | public boolean isSet(int sequenceNumber)(Code) | | Test if a particular bit is set.
Parameters: sequenceNumber - the bit to test. true if the specified bit has been set. |
set | public synchronized void set(int sequenceNumber)(Code) | | Set the bit corresponding to a particular sequence number. If the
word containing the bit falls beyond the end of the array, first
discard the words before the word containing minSequence. Then
expand the array if necessary.
|
|
|