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.
Modifier and Type | Class and Description |
---|---|
static interface |
ArraySortedSet.Comparator<T>
Comparator.
|
Constructor and Description |
---|
ArraySortedSet(ArraySortedSet.Comparator<T> comparator)
Public ctor.
|
ArraySortedSet(Collection<T> set)
Public ctor, with default comparator.
|
ArraySortedSet(Collection<T> set,
ArraySortedSet.Comparator<T> comparator)
Public ctor.
|
ArraySortedSet(Iterable<T> set)
Public ctor, with default comparator.
|
ArraySortedSet(Iterable<T> set,
ArraySortedSet.Comparator<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() |
ArraySortedSet.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(@NotNull(message="comparator can\'t be NULL") ArraySortedSet.Comparator<T> comparator)
comparator
- Comparator to usepublic ArraySortedSet(@NotNull(message="set can\'t be NULL") Collection<T> set, @NotNull(message="comparator can\'t be NULL") ArraySortedSet.Comparator<T> comparator)
set
- Original setcomparator
- Comparator to usepublic ArraySortedSet(@NotNull(message="set can\'t be NULL") Iterable<T> set, @NotNull(message="comparator can\'t be NULL") ArraySortedSet.Comparator<T> comparator)
set
- Original setcomparator
- Comparator to usepublic ArraySortedSet(@NotNull(message="set can\'t be NULL") T... set)
set
- Original setpublic ArraySortedSet(Collection<T> set)
set
- Original setpublic ArraySortedSet<T> with(@NotNull(message="value can\'t be NULL") T value)
value
- The valuepublic ArraySortedSet<T> with(@NotNull(message="list can\'t be NULL") Collection<T> vals)
vals
- Values to addpublic ArraySortedSet<T> without(@NotNull(message="value can\'t be NULL") T value)
value
- The valuepublic int hashCode()
public boolean equals(Object object)
public int size()
public boolean isEmpty()
public boolean contains(Object key)
public ArraySortedSet.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–2013 jcabi.com. All rights reserved.