Constructor and Description |
---|
FifoList(int intendedCapacity)
Constructor for the FifoList object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(T entry)
Adds an item to the list.
|
void |
clear()
Removes all items from the list.
|
boolean |
contains(T entry)
Checks whether an item is present in the list.
|
T |
getNewest()
Gets the item that has been the shortest time in the list.
|
T |
getOldest()
Gets the item that has been the longest time in the list.
|
boolean |
remove(T entry)
Removes an item from the list.
|
int |
size()
Returns the number of items stored in the list.
|
String |
toString()
Returns a text representation of the list.
|
public FifoList(int intendedCapacity)
intendedCapacity
- maximum number of items this list can hold (but can be exceeded whenever needed)public T getOldest()
public T getNewest()
public boolean add(T entry)
public boolean remove(T entry)
public boolean contains(T entry)
public int size()
Copyright © 2016 Egothor. All Rights Reserved.