Util
Class SynchedFifo

java.lang.Object
  |
  +--Util.SynchedFifo

public class SynchedFifo
extends java.lang.Object


Field Summary
private  java.util.LinkedList fifo
          A list holding messages.
 
Constructor Summary
SynchedFifo()
           
 
Method Summary
 java.lang.String get()
          Retrieve a message from the start of the fifo.
 boolean isEmpty()
          A predicate the checks if the fifo is empty
 void put(java.lang.String msg)
          Put a message in the end of the fifo.
 void reset()
          Clears the fifo content
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

fifo

private final java.util.LinkedList fifo
A list holding messages. It is first-in first-out based: items are put on its end, and are being recovered from its start.
Constructor Detail

SynchedFifo

public SynchedFifo()
Method Detail

put

public final void put(java.lang.String msg)
Put a message in the end of the fifo.
Parameters:
msg - The message to put

get

public final java.lang.String get()
Retrieve a message from the start of the fifo. The item is removed from the fifo.
Returns:
The retrieved message

reset

public final void reset()
Clears the fifo content

isEmpty

public final boolean isEmpty()
A predicate the checks if the fifo is empty
Returns:
True if empty