org.egothor.util
Class BlockingArray<T>

java.lang.Object
  extended by org.egothor.util.BlockingArray<T>

public class BlockingArray<T>
extends java.lang.Object

This class is used to replace the Sun's implementation in java.util.concurrent.

Author:
galambos

Constructor Summary
BlockingArray(int capacity)
           
 
Method Summary
 void dumpState()
           
 boolean issueLast(T e)
          Non-blocking pushLast which returns false if the array is actually full and the new element was not added.
 T popFirst()
           
 T popLast()
           
 void pushLast(T e)
           
 int size()
           
 boolean waitForEmpty(long delay)
          Waits until the array is empty or time passed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockingArray

public BlockingArray(int capacity)
Method Detail

dumpState

public void dumpState()

popFirst

public T popFirst()

popLast

public T popLast()

pushLast

public void pushLast(T e)

issueLast

public boolean issueLast(T e)
Non-blocking pushLast which returns false if the array is actually full and the new element was not added.


size

public int size()

waitForEmpty

public boolean waitForEmpty(long delay)
Waits until the array is empty or time passed.

Returns:
true, if the queue was freed, false when time passed