T
- public class SortedList<T>
extends java.lang.Object
implements java.util.SortedSet<T>, java.util.List<T>
Modifier and Type | Class and Description |
---|---|
private class |
SortedList.It |
Modifier and Type | Field and Description |
---|---|
private java.util.Comparator<? super T> |
comparator |
private static SortedList<?> |
EMPTY |
private int |
end |
private T[] |
list |
private int |
start |
private java.lang.Class<?> |
type |
Modifier | Constructor and Description |
---|---|
private |
SortedList() |
|
SortedList(java.util.Collection<? extends java.lang.Comparable<? super T>> x) |
|
SortedList(java.util.Collection<? extends T> x,
java.util.Comparator<? super T> cmp) |
|
SortedList(java.util.Collection<? extends T> x,
int start,
int end,
java.util.Comparator<? super T> cmp) |
|
SortedList(java.lang.Comparable<? super T>... x) |
|
SortedList(java.util.Comparator<? super T> cmp,
T... x) |
private |
SortedList(SortedList<T> other,
int start,
int end) |
|
SortedList(T[] x,
int start,
int end,
java.util.Comparator<? super T> cmp) |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
T element)
Deprecated.
|
boolean |
add(T e) |
boolean |
addAll(java.util.Collection<? extends T> c) |
boolean |
addAll(int index,
java.util.Collection<? extends T> c)
Deprecated.
|
void |
clear() |
java.util.Comparator<? super T> |
comparator() |
private int |
compare(T o1,
T o2) |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
static <T> java.util.SortedSet<T> |
empty() |
boolean |
equals(java.lang.Object other)
Deprecated.
|
private int |
find(java.lang.Object toElement)
Find the first element that is equal or bigger than the given element
|
T |
first() |
static <T extends java.lang.Comparable<? super T>> |
fromIterator(java.util.Iterator<? extends T> it) |
static <T> SortedList<T> |
fromIterator(java.util.Iterator<? extends T> it,
java.util.Comparator<? super T> cmp) |
T |
get(int index) |
java.lang.Class<?> |
getType() |
boolean |
hasDuplicates() |
int |
hashCode()
Deprecated.
|
SortedList<T> |
headSet(T toElement) |
int |
indexOf(java.lang.Object o) |
boolean |
isEmpty() |
boolean |
isEqual(SortedList<T> list) |
boolean |
isSubSet() |
java.util.Iterator<T> |
iterator() |
T |
last() |
int |
lastIndexOf(java.lang.Object o) |
java.util.ListIterator<T> |
listIterator() |
java.util.ListIterator<T> |
listIterator(int index) |
T |
remove(int index)
Deprecated.
|
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
retainAll(java.util.Collection<?> c) |
T |
set(int index,
T element)
Deprecated.
|
void |
setType(java.lang.Class<?> type) |
int |
size() |
SortedList<T> |
subList(int fromIndex,
int toIndex) |
SortedList<T> |
subSet(T fromElement,
T toElement) |
java.util.SortedSet<T> |
tailSet(T fromElement) |
java.lang.Object[] |
toArray() |
<X> X[] |
toArray(X[] a) |
java.lang.String |
toString() |
private static final SortedList<?> EMPTY
private final T[] list
private final int start
private final int end
private final java.util.Comparator<? super T> comparator
private java.lang.Class<?> type
public SortedList(java.util.Collection<? extends java.lang.Comparable<? super T>> x)
public SortedList(java.util.Collection<? extends T> x, java.util.Comparator<? super T> cmp)
@SafeVarargs public SortedList(java.lang.Comparable<? super T>... x)
private SortedList(SortedList<T> other, int start, int end)
public SortedList(java.util.Collection<? extends T> x, int start, int end, java.util.Comparator<? super T> cmp)
private SortedList()
public int size()
public boolean isEmpty()
public boolean contains(java.lang.Object o)
public java.util.Iterator<T> iterator()
public java.lang.Object[] toArray()
public <X> X[] toArray(X[] a)
public boolean add(T e)
public boolean remove(java.lang.Object o)
public boolean containsAll(java.util.Collection<?> c)
public boolean addAll(java.util.Collection<? extends T> c)
public boolean retainAll(java.util.Collection<?> c)
public boolean removeAll(java.util.Collection<?> c)
public void clear()
public java.util.Comparator<? super T> comparator()
comparator
in interface java.util.SortedSet<T>
public boolean isSubSet()
public SortedList<T> subSet(T fromElement, T toElement)
subSet
in interface java.util.SortedSet<T>
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List<T>
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List<T>
private int find(java.lang.Object toElement)
toElement
- public java.util.SortedSet<T> tailSet(T fromElement)
tailSet
in interface java.util.SortedSet<T>
public SortedList<T> headSet(T toElement)
headSet
in interface java.util.SortedSet<T>
@Deprecated public boolean addAll(int index, java.util.Collection<? extends T> c)
addAll
in interface java.util.List<T>
@Deprecated public T set(int index, T element)
set
in interface java.util.List<T>
@Deprecated public void add(int index, T element)
add
in interface java.util.List<T>
@Deprecated public T remove(int index)
remove
in interface java.util.List<T>
public java.util.ListIterator<T> listIterator()
listIterator
in interface java.util.List<T>
public java.util.ListIterator<T> listIterator(int index)
listIterator
in interface java.util.List<T>
public SortedList<T> subList(int fromIndex, int toIndex)
subList
in interface java.util.List<T>
@Deprecated public boolean equals(java.lang.Object other)
@Deprecated public int hashCode()
public boolean isEqual(SortedList<T> list)
public java.lang.Class<?> getType()
public void setType(java.lang.Class<?> type)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean hasDuplicates()
public static <T extends java.lang.Comparable<? super T>> SortedList<T> fromIterator(java.util.Iterator<? extends T> it)
public static <T> SortedList<T> fromIterator(java.util.Iterator<? extends T> it, java.util.Comparator<? super T> cmp)
public static <T> java.util.SortedSet<T> empty()