de.erichseifert.gral.util
Class SortedList<T extends java.lang.Comparable<T>>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<T>
-
- de.erichseifert.gral.util.SortedList<T>
-
- Type Parameters:
T- Data type of stored elements.
- All Implemented Interfaces:
- java.lang.Iterable<T>, java.util.Collection<T>, java.util.List<T>
public class SortedList<T extends java.lang.Comparable<T>> extends java.util.AbstractList<T>Resizable implementation of theListinterface that automatically sorts all values. It implements the methodsget,size,add, andsize. The stored elements must implement the interfaceComparable.
-
-
Constructor Summary
Constructors Constructor and Description SortedList()Constructs an empty list with an initial capacity of ten.SortedList(java.util.Collection<? extends T> c)Constructs a list containing the elements of the specified collection.SortedList(int initialCapacity)Constructs an empty list with the specified initial capacity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanadd(T e)Tget(int index)intindexOf(java.lang.Object o)Tremove(int index)intsize()-
Methods inherited from class java.util.AbstractList
add, addAll, clear, equals, hashCode, iterator, lastIndexOf, listIterator, listIterator, set, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
-
-
-
Constructor Detail
-
SortedList
public SortedList(int initialCapacity)
Constructs an empty list with the specified initial capacity.- Parameters:
initialCapacity- Initial capacity of the list.
-
SortedList
public SortedList(java.util.Collection<? extends T> c)
Constructs a list containing the elements of the specified collection.- Parameters:
c- Collection whose elements are to be added.
-
SortedList
public SortedList()
Constructs an empty list with an initial capacity of ten.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG