Package com.mchange.util.impl
Class CircularList
java.lang.Object
com.mchange.util.impl.CircularList
- All Implemented Interfaces:
Cloneable
CircularList is a list class. Objects can be added at the beginning or end; they may be enumerated through forwards or backwards; they may be retrieved directly or by index from the front or rear. CircularLists can also be enumerated endlessly. If the list contains any elements at all, an "unterminated" Enumeration will always claim to have more elements... when it's done enumerating, it will start over again. The default Enumeration is of the usual, terminated variety, however.
This class is a completely UNSYNCHRONIZED implementation class. Synchronize on calls where necessary.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addElementToFront
(Object object) void
appendElement
(Object object) clone()
Returns a shallow copy.elements()
elements
(boolean forward) elements
(boolean forward, boolean terminated) getElementFromBack
(int index) getElementFromFront
(int index) static void
void
void
void
removeFromBack
(int count) void
removeFromFront
(int count) void
int
size()
-
Constructor Details
-
CircularList
public CircularList()
-
-
Method Details
-
appendElement
-
addElementToFront
-
removeFirstElement
public void removeFirstElement() -
removeLastElement
public void removeLastElement() -
removeFromFront
public void removeFromFront(int count) -
removeFromBack
public void removeFromBack(int count) -
removeAllElements
public void removeAllElements() -
getElementFromFront
-
getElementFromBack
-
getFirstElement
-
getLastElement
-
elements
-
elements
-
elements
-
size
public int size() -
clone
Returns a shallow copy. The list is cloned, but not the elements within it. -
main
-