Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class fi.hut.tcm.jacob.utility.Queue

java.lang.Object
  |
  +--fi.hut.tcm.jacob.utility.Buffer
        |
        +--fi.hut.tcm.jacob.utility.Queue
Subclasses:
OrderedQueue

public class Queue
extends fi.hut.tcm.jacob.utility.Buffer
implements Storage
Queue A Queue is used to store Items which can be MessageTransporters, or Controllers (i.e. Visitors).


Constructor Summary
Queue()
          This is overloaded constructor of the Queue.
Queue(int initialSize)
          This is overloaded constructor of the Queue.
 
Method Summary
boolean empty()
          Return true if storage is empty otherwise false.
boolean full()
          Returns true if storage is full otherwise false.
void put(java.lang.Object item)
          Adds item to storage and notifyes all waiting take method calls.
java.lang.Object take()
          Removes one Item from Queue and returns reference to it.
 
Methods inherited from class fi.hut.tcm.jacob.utility.Buffer
empty, enlarge, full, get, getHead, getLength, getTail, has, put, putHead, putTail, take, take, takeHead, takeTail, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Constructor Detail

Queue

public Queue()
This is overloaded constructor of the Queue. It uses defaultsize for new storage.

Queue

public Queue(int initialSize)
This is overloaded constructor of the Queue. It uses given initialSize for new storage.
Method Detail

full

public boolean full()
Returns true if storage is full otherwise false. This method is used unsynchronized.
Specified by:
full in interface Storage
Overrides:
full in class fi.hut.tcm.jacob.utility.Buffer

empty

public boolean empty()
Return true if storage is empty otherwise false. This method is used unsynchronized.
Specified by:
empty in interface Storage
Overrides:
empty in class fi.hut.tcm.jacob.utility.Buffer

put

public void put(java.lang.Object item)
Adds item to storage and notifyes all waiting take method calls. This is used synchronized.
Specified by:
put in interface Storage

take

public java.lang.Object take()
Removes one Item from Queue and returns reference to it. If the Queue is empty this method call blocks until notifyed (by put method). This is used synchronized.
Specified by:
take in interface Storage

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD