public interface IBoundedList<T>
extends java.lang.Iterable<T>
Interface presented by class types representing bounded lists, that is, bounded buffers. This interface is primarily indicative in nature, obviate the intention of the exposing type. However, it does contain most of the methods typically needed to use such a collection.
An important aspect of a bounded buffer is the iterator it provides. For example, are the
contained elements traversed first in first out, last in first out, as a queue, as a
dequeue, etc. Thus, this interface inherits from the
interface in anticipation of such an iteration process.
Iterable
Modifier and Type | Method and Description |
---|---|
void |
add(T item)
Adds an object to the list, potentially pushing off the oldest object
if the buffer is full.
|
void |
clear()
Clears the entire contents of the list.
|
T |
get(int index)
Return the object at the specified index position in this list.
|
int |
size()
Returns the size of the bounded list.
|
int size()
void add(T item)
objNew
- object to be inserted into the listT get(int index)
index
- index position into the listvoid clear()