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.Pool

java.lang.Object
  |
  +--fi.hut.tcm.jacob.utility.Buffer
        |
        +--fi.hut.tcm.jacob.utility.Pool

public final class Pool
extends fi.hut.tcm.jacob.utility.Buffer
implements Storage
Pool A Pool is used to store objects i.e. MessageTransporters, Controllers or Timeouts (i.e. Visitors).


Constructor Summary
Pool()
          This is overloaded constructor of the Pool.
Pool(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 the Pool.
java.lang.Object take()
          Removes one Item from Pool 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

Pool

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

Pool

public Pool(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 the Pool. This is used synchronized.
Specified by:
put in interface Storage

take

public java.lang.Object take()
Removes one Item from Pool and returns reference to it. If the Queue is empty returns null. 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