Top Description Fields Constructors Methods
com.mchange.util.impl

public Class CircularList

Additional top-level classes in compilation unit: CircularListEnumeration, CircularListRecord.

extends Object
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable
Imports
java.util.*, com.mchange.util.*

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.

Field Summary

Modifier and TypeField and Description
pack-priv CircularListRecord
pack-priv int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
addElement(Object object, boolean first)

public void
public void
public Object
clone()

Overrides java.lang.Object.clone.

Returns a shallow copy.

public Enumeration<E>
elements(boolean forward, boolean terminated)

public Enumeration<E>
elements(boolean forward)

public Enumeration<E>
public Object
getElementFromBack(int index)

public Object
public Object
public Object
public static void
main(String[] argv)

public void
private void
removeElement(boolean first)

public void
public void
removeFromBack(int count)

public void
removeFromFront(int count)

public void
public int
size()

private void
Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

firstRecordback to summary
pack-priv CircularListRecord firstRecord
sizeback to summary
pack-priv int size

Constructor Detail

CircularListback to summary
public CircularList()

Method Detail

addElementback to summary
private void addElement(Object object, boolean first)
addElementToFrontback to summary
public void addElementToFront(Object object)
appendElementback to summary
public void appendElement(Object object)
cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Returns a shallow copy. The list is cloned, but not the elements within it.

Returns:Object

Doc from java.lang.Object.clone.

a clone of this instance.

elementsback to summary
public Enumeration<E> elements(boolean forward, boolean terminated)
elementsback to summary
public Enumeration<E> elements(boolean forward)
elementsback to summary
public Enumeration<E> elements()
getElementFromBackback to summary
public Object getElementFromBack(int index)
getElementFromFrontback to summary
public Object getElementFromFront(int index)
getFirstElementback to summary
public Object getFirstElement()
getLastElementback to summary
public Object getLastElement()
mainback to summary
public static void main(String[] argv)
removeAllElementsback to summary
public void removeAllElements()
removeElementback to summary
private void removeElement(boolean first)
removeFirstElementback to summary
public void removeFirstElement()
removeFromBackback to summary
public void removeFromBack(int count)
removeFromFrontback to summary
public void removeFromFront(int count)
removeLastElementback to summary
public void removeLastElement()
sizeback to summary
public int size()
zapback to summary
private void zap(CircularListRecord record)