Package xal.tools.collections
Interface IBoundedList<T>
- All Superinterfaces:
Iterable<T>
- All Known Implementing Classes:
LinearBuffer
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
- Since:
- Apr 11, 2013
- Author:
- Christopher K. Allen
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.get
(int index) Return the object at the specified index position in this list.int
size()
Returns the size of the bounded list.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
size
int size()Returns the size of the bounded list.- Returns:
- maximum number of objects that the list can manage
- Since:
- Apr 11, 2013
-
add
Adds an object to the list, potentially pushing off the oldest object if the buffer is full.- Parameters:
item
- object to be inserted into the list- Since:
- Apr 11, 2013
-
get
Return the object at the specified index position in this list. The relative meaning of the index may be interpreted differently for each type of list.- Parameters:
index
- index position into the list- Returns:
- object at position index
- Since:
- Apr 11, 2013
-
clear
void clear()Clears the entire contents of the list. That is, empties the current list.- Since:
- Apr 11, 2013
-