public class FastSortedTable<E> extends FastTable<E>
A high-performance sorted table with real-time
behavior;
smooth capacity increase/decrease and minimal memory footprint.
Fast 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.StandardText
Modifier | Constructor and Description |
---|---|
|
FastSortedTable()
Creates an empty table sorted using its elements natural order.
|
|
FastSortedTable(EqualityComparator<? 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 |
---|---|
FastSortedTable<E> |
addAll(E... elements)
Returns this collection with the specified element added.
|
FastSortedTable<E> |
addAll(FastCollection<? extends E> that)
Returns this collection with the specified collection's elements added.
|
int |
addIfAbsent(E element)
Adds the specified element only if not already present.
|
boolean |
contains(Object obj)
Sorted table operations optimizations.
|
int |
indexOf(Object obj) |
boolean |
remove(Object obj) |
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.
|
int |
slotOf(E element)
Returns the would index of the specified element if it were
to be added to this sorted table.
|
FastSortedTable<E> |
subTable(int fromIndex,
int toIndex)
Returns a view over a portion of the table (equivalent to
List.subList(int, int) ). |
FastSortedTable<E> |
unmodifiable()
Views.
|
add, addAll, addFirst, addLast, clear, descendingIterator, element, get, getFirst, getLast, isEmpty, iterator, lastIndexOf, listIterator, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, reversed, set, size, sort, subList
add, addAll, atomic, comparator, comparator, containsAll, distinct, doWhile, equals, filtered, forEach, hashCode, mapped, parallel, reduce, removeAll, removeIf, retainAll, sequential, serviceOf, sorted, toArray, toArray, toImmutable, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public FastSortedTable()
public FastSortedTable(EqualityComparator<? super E> comparator)
protected FastSortedTable(SortedTableService<E> service)
public FastSortedTable<E> unmodifiable()
unmodifiable
in class FastTable<E>
public FastSortedTable<E> shared()
FastCollection
immutable
collections to be replaced at each update rather than shared views.shared
in class FastTable<E>
public FastSortedTable<E> subTable(int fromIndex, int toIndex)
FastTable
List.subList(int, int)
).@Realtime(limit=LOG_N) public boolean contains(Object obj)
public int addIfAbsent(E element)
@Realtime(limit=LOG_N) public int slotOf(E element)
public FastSortedTable<E> addAll(E... elements)
FastCollection
public FastSortedTable<E> addAll(FastCollection<? extends E> that)
FastCollection
protected SortedTableService<E> service()
FastCollection
Copyright © 2005-2013 Javolution. All Rights Reserved.