|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.sapportals.portal.prt.util.FiFoList
FiFoList - implementation of a first-in first-out list. The list has a fixed size. Neither put nor get are blocked if the list is full or empty. A put on a full list deletes the item that came earliest into the list. A get on an empty list returns null. The list is efficient because the underlying data structure is an array which end is connected to its begin. Internally elements are never shifted in the list. Instead the index for begin and end in the array is changed. The list is synchronized.
| Constructor Summary | |
FiFoList(int size)
Create a first-in first-out list with the given size. |
|
| Method Summary | |
java.lang.Object |
get()
Get an item from the list. |
int |
getNumberOfItems()
Returns the number of available items. |
boolean |
isEmpty()
Checks if the list is currently empty. |
java.lang.Object |
lookupNext()
Look up the next item. |
java.lang.Object |
put(java.lang.Object item)
Put an item in the list. |
void |
setLogger(ILogger logger)
There is some logging in the list which can be activated by setting the logger. |
java.lang.String |
toString()
Prints the state of the list and its content. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public FiFoList(int size)
| Method Detail |
public void setLogger(ILogger logger)
public java.lang.Object get()
public java.lang.Object put(java.lang.Object item)
public java.lang.Object lookupNext()
public int getNumberOfItems()
public boolean isEmpty()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||