T
- Value key type@Immutable @Loggable(value=1) public final class ArraySortedSet<T> extends Object implements SortedSet<T>
This class is truly immutable. This means that it never changes
its encapsulated values and is annotated with @Immutable
annotation.
Constructor and Description |
---|
ArraySortedSet(ArrayComparator<T> comparator)
Public ctor.
|
ArraySortedSet(ArrayComparator<T> comparator,
T... set)
Public ctor.
|
ArraySortedSet(Iterable<T> set)
Public ctor, with default comparator.
|
ArraySortedSet(Iterable<T> set,
ArrayComparator<T> comparator)
Public ctor.
|
ArraySortedSet(T... set)
Public ctor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(T element) |
boolean |
addAll(Collection<? extends T> col) |
void |
clear() |
Comparator<? super T> |
comparator() |
boolean |
contains(Object key) |
boolean |
containsAll(Collection<?> col) |
boolean |
equals(Object object) |
T |
first() |
int |
hashCode() |
SortedSet<T> |
headSet(T till) |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
T |
last() |
boolean |
remove(Object obj) |
boolean |
removeAll(Collection<?> col) |
boolean |
retainAll(Collection<?> col) |
int |
size() |
SortedSet<T> |
subSet(T from,
T till) |
SortedSet<T> |
tailSet(T from) |
Object[] |
toArray() |
<T> T[] |
toArray(T[] array) |
String |
toString() |
ArraySortedSet<T> |
with(Collection<T> vals)
Make a new one with some extra entries.
|
ArraySortedSet<T> |
with(T value)
Make a new one with an extra entry.
|
ArraySortedSet<T> |
without(T value)
Make a new one without an extra entry.
|
public ArraySortedSet(ArrayComparator<T> comparator)
comparator
- Comparator to usepublic ArraySortedSet(T... set)
set
- Original setpublic ArraySortedSet(ArrayComparator<T> comparator, T... set)
comparator
- The comparator to useset
- Original setpublic ArraySortedSet(Iterable<T> set)
set
- Original setpublic ArraySortedSet(Iterable<T> set, ArrayComparator<T> comparator)
set
- Original setcomparator
- Comparator to usepublic ArraySortedSet<T> with(T value)
value
- The valuepublic ArraySortedSet<T> with(Collection<T> vals)
vals
- Values to addpublic ArraySortedSet<T> without(T value)
value
- The valuepublic int hashCode()
public boolean equals(Object object)
public int size()
public boolean isEmpty()
public boolean contains(Object key)
public Comparator<? super T> comparator()
comparator
in interface SortedSet<T>
public Object[] toArray()
public <T> T[] toArray(T[] array)
public boolean add(T element)
public boolean remove(Object obj)
public boolean containsAll(Collection<?> col)
containsAll
in interface Collection<T>
containsAll
in interface Set<T>
public boolean addAll(Collection<? extends T> col)
public boolean retainAll(Collection<?> col)
public boolean removeAll(Collection<?> col)
Copyright © 2012–2014 jcabi.com. All rights reserved.