Java EE 5 SDK

com.sun.appserv.management.util.misc
Class CircularList<T>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<T>
          extended by com.sun.appserv.management.util.misc.CircularList<T>
All Implemented Interfaces:
Iterable<T>, Collection<T>, List<T>

public final class CircularList<T>
extends AbstractList<T>

A circular list implementation


Nested Class Summary
static interface CircularList.OverflowHandler
           
 
Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
CircularList(Class<T> theClass, int size)
           
 
Method Summary
 void add(int index, T item)
          May be added to the end only.
 boolean add(T item)
           
 int capacity()
           
 void clear()
           
protected  void discardedObject(T o)
           
 boolean equals(Object rhsIn)
           
 T get(int i)
           
 CircularList.OverflowHandler getOverflowHandler()
           
 T remove(int i)
           
 T removeFirst()
           
 T removeLast()
           
 T set(int i, T item)
           
 void setOverflowHandler(CircularList.OverflowHandler handler)
           
 int size()
           
 String toString()
           
 
Methods inherited from class java.util.AbstractList
addAll, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

CircularList

public CircularList(Class<T> theClass,
                    int size)
Method Detail

setOverflowHandler

public void setOverflowHandler(CircularList.OverflowHandler handler)

getOverflowHandler

public CircularList.OverflowHandler getOverflowHandler()

size

public final int size()
Specified by:
size in interface Collection<T>
Specified by:
size in interface List<T>
Specified by:
size in class AbstractCollection<T>

capacity

public final int capacity()

clear

public final void clear()
Specified by:
clear in interface Collection<T>
Specified by:
clear in interface List<T>
Overrides:
clear in class AbstractList<T>

get

public final T get(int i)
Specified by:
get in interface List<T>
Specified by:
get in class AbstractList<T>

set

public final T set(int i,
                   T item)
Specified by:
set in interface List<T>
Overrides:
set in class AbstractList<T>

discardedObject

protected void discardedObject(T o)

add

public final boolean add(T item)
Specified by:
add in interface Collection<T>
Specified by:
add in interface List<T>
Overrides:
add in class AbstractList<T>

add

public final void add(int index,
                      T item)
May be added to the end only.

Specified by:
add in interface List<T>
Overrides:
add in class AbstractList<T>

remove

public final T remove(int i)
Specified by:
remove in interface List<T>
Overrides:
remove in class AbstractList<T>

removeFirst

public final T removeFirst()

removeLast

public final T removeLast()

equals

public boolean equals(Object rhsIn)
Specified by:
equals in interface Collection<T>
Specified by:
equals in interface List<T>
Overrides:
equals in class AbstractList<T>

toString

public String toString()
Overrides:
toString in class AbstractCollection<T>

Java EE 5 SDK

Submit a bug or feature

Copyright 2006 Sun Microsystems, Inc. All rights reserved.