E - - The type of item stores in the fifopublic class SimpleFifo<E> extends Object implements Fifo<E>, Iterable<E>, Serializable
| Modifier and Type | Class and Description |
|---|---|
protected class |
SimpleFifo.Node |
| Modifier and Type | Field and Description |
|---|---|
protected SimpleFifo.Node |
head |
| Constructor and Description |
|---|
SimpleFifo() |
SimpleFifo(E[] els) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all items in the queue.
|
boolean |
contains(E item)
Check if this queue contains the given item.
|
protected boolean |
equals(E one,
E two) |
protected void |
finalize() |
Iterable<E> |
forEach() |
Fifo<E> |
give(E item)
Analagous to add(), however, we do not use the standard naming convention,
to avoid interface clashes with adapter types in collection libraries
that may wish to override our Fifo with their own type.
|
Fifo<E> |
giveAll(E... elements)
Analagous to addAll(), however, we avoid the standard naming convention,
so we can provide a fluent, strongly typed api.
|
Fifo<E> |
giveAll(Iterable<E> elements)
Analagous to addAll(), however, we avoid the standard naming convention,
so we can provide a fluent, strongly typed api.
|
boolean |
isEmpty()
Fastest way to tell if the queue is drained.
|
Iterator<E> |
iterator() |
String |
join(String delim) |
String |
join(String delim,
ConvertsValue<E,String> serializer) |
boolean |
remove(E item)
Manually remove the item from queue.
|
protected String |
serialize(ConvertsValue<E,String> serializer,
E item) |
int |
size()
Return a count of items in the queue.
|
E |
take()
Analagous to poll(); retrieves and removes head.
|
String |
toString() |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorprotected SimpleFifo.Node head
public SimpleFifo()
public SimpleFifo(E[] els)
public boolean contains(E item)
Fifopublic Fifo<E> give(E item)
Fifopublic void clear()
Fifopublic boolean remove(E item)
Fifopublic E take()
Fifopublic int size()
Fifopublic boolean isEmpty()
Fifoprotected void finalize()
throws Throwable
public String join(String delim, ConvertsValue<E,String> serializer)
protected String serialize(ConvertsValue<E,String> serializer, E item)
public Fifo<E> giveAll(E... elements)
FifoCopyright © December 07, 2012–2015 The Internet Party. All rights reserved.