AXL RADIUS Server API V3

com.theorem.misc
Class CircularList

Object
  extended byAbstractCollection
      extended byAbstractList
          extended byArrayList
              extended byCircularList
All Implemented Interfaces:
Cloneable, Collection, List, RandomAccess, Serializable

public class CircularList
extends ArrayList

Class to hold a circular list. The contents are returned by the next() method. Note that this implementation is not synchronized. If multiple threads access the CircularList instance concurrently, and at least one of the threads modifies the list structurally, it must be synchronized externally. (A structural modification is any operation that adds or deletes one or more elements, or explicitly resizes the backing array; merely setting the value of an element is not a structural modification.) This is typically accomplished by synchronizing on some object that naturally encapsulates the list. If no such object exists, the list should be "wrapped" using the Collections.synchronizedList method. This is best done at creation time, to prevent accidental unsynchronized access to the list:

        List list = Collections.synchronizedList(new CircularList(...));
 

See Also:
Serialized Form

Constructor Summary
CircularList()
          Constructs an empty list with an initial capacity of ten.
CircularList(Collection c)
          Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator.
CircularList(int initialCapacity)
           
 
Method Summary
 Object next()
          Get the next object in the circular list.
 
Methods inherited from class ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, set, size, toArray, toArray, trimToSize
 
Methods inherited from class AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class AbstractCollection
containsAll, remove, removeAll, retainAll, toString
 
Methods inherited from class Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface List
containsAll, equals, hashCode, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList
 

Constructor Detail

CircularList

public CircularList()
Constructs an empty list with an initial capacity of ten.


CircularList

public CircularList(Collection c)
Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator. The CircularList instance has an initial capacity of 110% the size of the specified collection.

Parameters:
c - The collection whose elements are to be placed into this list.

CircularList

public CircularList(int initialCapacity)
Parameters:
initialCapacity - The initial capacity of the list.
Method Detail

next

public Object next()
Get the next object in the circular list.

Returns:
Next object, which may be null.

AXL RADIUS Server API V3

Submit a bug report or feature request

Copyright 1998-2008 AXL Software. PO Box 97, Viola, Delaware 19979, U.S.A. All Rights Reserved.