Package net.hydromatic.morel.util
Class ComparableSingletonList<E extends Comparable<E>>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- net.hydromatic.morel.util.ComparableSingletonList<E>
-
- Type Parameters:
E- Element type
- All Implemented Interfaces:
Comparable<ComparableSingletonList<E>>,Iterable<E>,Collection<E>,List<E>
public class ComparableSingletonList<E extends Comparable<E>> extends AbstractList<E> implements Comparable<ComparableSingletonList<E>>
A comparable singleton list.
-
-
Field Summary
Fields Modifier and Type Field Description private Eelement-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description ComparableSingletonList(E element)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(ComparableSingletonList<E> o)Eget(int index)static <E extends Comparable<E>>
ComparableSingletonList<E>of(E e)Creates a ComparableSingletonList.intsize()-
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
-
-
-
Field Detail
-
element
private final E extends Comparable<E> element
-
-
Constructor Detail
-
ComparableSingletonList
ComparableSingletonList(E element)
-
-
Method Detail
-
of
public static <E extends Comparable<E>> ComparableSingletonList<E> of(E e)
Creates a ComparableSingletonList.
-
get
public E get(int index)
- Specified by:
getin interfaceList<E extends Comparable<E>>- Specified by:
getin classAbstractList<E extends Comparable<E>>
-
size
public int size()
- Specified by:
sizein interfaceCollection<E extends Comparable<E>>- Specified by:
sizein interfaceList<E extends Comparable<E>>- Specified by:
sizein classAbstractCollection<E extends Comparable<E>>
-
compareTo
public int compareTo(ComparableSingletonList<E> o)
- Specified by:
compareToin interfaceComparable<E extends Comparable<E>>
-
-