T
- The entry type.public final class ASortedSet<T> extends TreeSet<T>
TreeSet
.
Provides various convenience methods for creating and populating a sorted set with minimal code.
Constructor and Description |
---|
ASortedSet()
Constructor.
|
ASortedSet(Collection<T> c)
Copy constructor.
|
ASortedSet(Comparator<T> c)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
ASortedSet<T> |
a(T... t)
Add.
|
ASortedSet<T> |
a(T t)
Add.
|
ASortedSet<T> |
aa(Collection<T> c)
Add all.
|
ASortedSet<T> |
aif(boolean b,
T t)
Add if.
|
ASortedSet<T> |
aifnn(T... t)
Add if not null.
|
<T2> T2[] |
asArrayOf(Class<T2> c)
Convert the contents of this set into a new array.
|
String |
asString()
Convert to Simplified JSON.
|
String |
asString(WriterSerializer ws)
Convert to a string using the specified serializer.
|
static <T> ASortedSet<T> |
of(T... t)
Convenience method for creating a list of objects.
|
String |
toString()
Convert to Simplified JSON.
|
SortedSet<T> |
unmodifiable()
Returns an unmodifiable view of this set.
|
add, addAll, ceiling, clear, clone, comparator, contains, descendingIterator, descendingSet, first, floor, headSet, headSet, higher, isEmpty, iterator, last, lower, pollFirst, pollLast, remove, size, spliterator, subSet, subSet, tailSet, tailSet
equals, hashCode, removeAll
containsAll, retainAll, toArray, toArray
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray
parallelStream, removeIf, stream
public ASortedSet()
public ASortedSet(Comparator<T> c)
c
- Comparator.public ASortedSet(Collection<T> c)
c
- Initial contents. Can be @SafeVarargs public static <T> ASortedSet<T> of(T... t)
t
- The initial values.public ASortedSet<T> a(T t)
Adds an entry to this set.
t
- The entry to add to this set.public ASortedSet<T> a(T... t)
Adds multiple entries to this set.
t
- The entries to add to this set.public ASortedSet<T> aa(Collection<T> c)
Adds multiple entries to this set.
c
- The entries to add to this set.public ASortedSet<T> aif(boolean b, T t)
Adds a value to this set if the boolean value is
b
- The boolean value.t
- The value to add.public ASortedSet<T> aifnn(T... t)
Adds entries to this set skipping
t
- The objects to add to the list.public SortedSet<T> unmodifiable()
public <T2> T2[] asArrayOf(Class<T2> c)
c
- The component type of the array.public String asString(WriterSerializer ws)
ws
- The serializer to use to serialize this collection.public String asString()
public String toString()
toString
in class AbstractCollection<T>
Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.