public final class MessageBufferMap<I>
extends java.lang.Object
Constructor and Description |
---|
MessageBufferMap() |
Modifier and Type | Method and Description |
---|---|
void |
add(I id)
Add an id to the buffer map
|
void |
append(I id,
java.lang.Object message,
ActorRef ref)
Append an element to the buffer for an id.
|
boolean |
contains(I id)
Check if the buffer map contains an id.
|
void |
foreach(scala.Function2<I,MessageBuffer,scala.runtime.BoxedUnit> f)
Iterate over all elements of the buffer map and apply a function to each element.
|
void |
forEach(Procedure2<I,MessageBuffer> f)
Java API
|
MessageBuffer |
getOrEmpty(I id)
Get the message buffer for an id, or an empty buffer if the id doesn't exist in the map.
|
boolean |
isEmpty()
Check if the buffer map is empty.
|
boolean |
nonEmpty()
Check if the buffer map is not empty.
|
void |
remove(I id)
Remove the buffer for an id.
|
int |
size()
How many ids are in the buffer map.
|
int |
totalSize()
How many elements are in the buffers in the buffer map.
|
public boolean isEmpty()
public boolean nonEmpty()
public int size()
public int totalSize()
public void add(I id)
id
- (undocumented)public void append(I id, java.lang.Object message, ActorRef ref)
id
- the id to add the element tomessage
- the message to bufferref
- the actor to bufferpublic void remove(I id)
id
- the id to remove the buffer forpublic boolean contains(I id)
id
- the id to check forpublic MessageBuffer getOrEmpty(I id)
id
- the id to get the message buffer forpublic void foreach(scala.Function2<I,MessageBuffer,scala.runtime.BoxedUnit> f)
f
- the function to apply to each elementpublic void forEach(Procedure2<I,MessageBuffer> f)
Iterate over all elements of the buffer map and apply a function to each element.
f
- the function to apply to each element