public class FastSortedTable<E> extends FastTable<E>
A high-performance sorted table with real-time behavior.
Sorted table have significantly faster contains(java.lang.Object),
indexOf(java.lang.Object) and remove(java.lang.Object) methods).
This class is comparable to FastSortedSet in performance,
but it allows for duplicate and implements the List
interface.
FastCollection.Text| Modifier | Constructor and Description |
|---|---|
|
FastSortedTable()
Creates an empty table sorted using its elements natural order.
|
|
FastSortedTable(Comparator<? super E> comparator)
Creates an empty table sorted using the specified element comparator.
|
protected |
FastSortedTable(SortedTableService<E> service)
Creates a sorted table backed up by the specified service implementation.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addIfAbsent(E element)
Adds the specified element only if not already present.
|
FastSortedTable<E> |
atomic()
Returns an atomic view over this collection.
|
boolean |
contains(Object obj)
Indicates if this collection contains the specified element.
|
int |
indexOf(Object obj)
Returns the index of the first occurrence of the specified element in this table,
or -1 if this table does not contain the element.
|
static <E> FastSortedTable<E> |
of(Collection<? extends E> that)
Returns a new sorted table holding the same elements as the specified
collection (convenience method).
|
static <E> FastSortedTable<E> |
of(E... elements)
Returns a new sorted table holding the specified elements
(convenience method).
|
int |
positionOf(E element)
Returns the index of the specified element if present; or a negative
number equals to
-n with n being the index next to
the "would be" index of the specified element if the specified element
was to be added. |
boolean |
remove(Object obj)
Removes the specified element from this collection.
|
protected SortedTableService<E> |
service()
Returns the service implementation of this collection (for sub-classes).
|
FastSortedTable<E> |
shared()
Returns a thread-safe view over this collection.
|
FastSortedTable<E> |
unmodifiable()
Returns an unmodifiable view over this collection.
|
add, addAll, addFirst, addLast, clear, descendingIterator, element, get, getFirst, getLast, isEmpty, lastIndexOf, listIterator, listIterator, mapped, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, reversed, set, size, sort, subList, subTableadd, addAll, any, comparator, comparator, containsAll, distinct, equals, filtered, forEach, hashCode, iterator, max, min, parallel, perform, reduce, removeAll, removeIf, retainAll, sequential, serviceOf, sorted, sorted, toArray, toArray, toString, updateclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic FastSortedTable()
public FastSortedTable(Comparator<? super E> comparator)
protected FastSortedTable(SortedTableService<E> service)
public static <E> FastSortedTable<E> of(E... elements)
public static <E> FastSortedTable<E> of(Collection<? extends E> that)
public FastSortedTable<E> atomic()
FastCollectionConcurrentModificationException possible).public FastSortedTable<E> shared()
FastCollectionConcurrentModificationException possible).public FastSortedTable<E> unmodifiable()
FastCollectionUnsupportedOperationException being raised.unmodifiable in class FastTable<E>@Realtime(limit=LOG_N) public boolean contains(Object obj)
FastCollection@Realtime(limit=LOG_N) public boolean remove(Object obj)
FastCollection@Realtime(limit=LOG_N) public int indexOf(Object obj)
FastTable@Realtime(limit=LOG_N) public boolean addIfAbsent(E element)
true if the element has been added;
false otherwise.@Realtime(limit=LOG_N) public int positionOf(E element)
-n with n being the index next to
the "would be" index of the specified element if the specified element
was to be added.protected SortedTableService<E> service()
FastCollectionCopyright © 2017. All rights reserved.