Package fr.dyade.aaa.agent
Class NGNetwork.MessageVector
- java.lang.Object
-
- fr.dyade.aaa.agent.NGNetwork.MessageVector
-
-
Field Summary
Fields Modifier and Type Field Description private intcurrentThe actual item in this MessageVector object.private intelementCountThe number of valid components in this MessageVector object.private Message[]elementDataThe array buffer into which the components of the vector are stored.
-
Constructor Summary
Constructors Constructor Description MessageVector()Constructs an empty vector with the specified initial capacity and capacity increment.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMessage(Message msg)Adds the specified component to the end of this vector, increasing its size by one.MessagenextMessage()voidremoveCurrent()MessageremoveMessage(int stamp)Removes a message specified by its stamp.voidreset()intsize()Returns the number of message in this vector.StringtoString()
-
-
-
Field Detail
-
elementData
private Message[] elementData
The array buffer into which the components of the vector are stored. The capacity of the vector is the length of this array buffer, and is at least large enough to contain all the vector's elements.Any array elements following the last element in the Vector are null.
-
elementCount
private int elementCount
The number of valid components in this MessageVector object.
-
current
private int current
The actual item in this MessageVector object.
-
-
Method Detail
-
nextMessage
public Message nextMessage()
-
size
public int size()
Returns the number of message in this vector.- Returns:
- the number of message in this vector.
-
reset
public void reset()
-
addMessage
public void addMessage(Message msg)
Adds the specified component to the end of this vector, increasing its size by one. The capacity of this vector is increased if its size becomes greater than its capacity.- Parameters:
msg- the component to be added.
-
removeCurrent
public void removeCurrent()
-
removeMessage
public Message removeMessage(int stamp)
Removes a message specified by its stamp. Only remove real message, this method don't touch to acknowledge message.- Parameters:
stamp- the stamp of the message to remove.- Returns:
- the removed message.
-
-