Javolution 6.0.0 java
|
Public Member Functions | |
FastTable () | |
FastTable (Equality<? super E > comparator) | |
FastTable< E > | atomic () |
FastTable< E > | reversed () |
FastTable< E > | shared () |
FastTable< E > | unmodifiable () |
FastTable< E > | subTable (int fromIndex, int toIndex) |
boolean | isEmpty () |
int | size () |
void | clear () |
void | add (int index, E element) |
boolean | addAll (final int index, Collection<? extends E > elements) |
E | remove (int index) |
E | get (int index) |
E | set (int index, E element) |
int | indexOf (Object element) |
int | lastIndexOf (final Object element) |
ListIterator< E > | listIterator () |
ListIterator< E > | listIterator (int index) |
void | addFirst (E element) |
void | addLast (E element) |
E | getFirst () |
E | getLast () |
E | peekFirst () |
E | peekLast () |
E | pollFirst () |
E | pollLast () |
E | removeFirst () |
E | removeLast () |
boolean | offerFirst (E e) |
boolean | offerLast (E e) |
boolean | removeFirstOccurrence (Object o) |
boolean | removeLastOccurrence (Object o) |
boolean | offer (E e) |
E | remove () |
E | poll () |
E | element () |
E | peek () |
void | push (E e) |
E | pop () |
Iterator< E > | descendingIterator () |
void | sort () |
FastTable< E > | addAll (E... elements) |
FastTable< E > | addAll (FastCollection<? extends E > that) |
FastTable< E > | subList (int fromIndex, int toIndex) |
FastCollection< E > | parallel () |
FastCollection< E > | sequential () |
FastCollection< E > | filtered (Predicate<? super E > filter) |
FastCollection< E > | sorted () |
FastCollection< E > | sorted (Comparator<? super E > cmp) |
FastCollection< E > | distinct () |
void | perform (Consumer<? extends Collection< E >> action) |
void | update (Consumer<? extends Collection< E >> action) |
void | forEach (final Consumer<? super E > consumer) |
boolean | removeIf (final Predicate<? super E > filter) |
E | reduce (Reducer< E > reducer) |
boolean | add (E element) |
boolean | contains (Object searched) |
boolean | remove (Object searched) |
Iterator< E > | iterator () |
boolean | addAll (final Collection<? extends E > that) |
boolean | containsAll (Collection<?> that) |
boolean | removeAll (final Collection<?> that) |
boolean | retainAll (final Collection<?> that) |
Object[] | toArray () |
E | min () |
E | max () |
Equality<? super E > | comparator () |
boolean | equals (Object obj) |
int | hashCode () |
String | toString () |
Protected Member Functions | |
FastTable (TableService< E > service) | |
TableService< E > | service () |
Static Protected Member Functions | |
static< E > CollectionService< E > | serviceOf (FastCollection< E > collection) |
Package Functions | |
public< R > FastCollection< R > | mapped (Function<? super E, ? extends R > function) |
public< T > T[] | toArray (final T[] array) |
public< T extends E > T | any (Class< T > type) |
public< T extends Collection< E > > Immutable< T > | toImmutable () |
Private Attributes | |
final TableService< E > | service |
Static Private Attributes | |
static final long | serialVersionUID = 0x600L |
A high-performance table (fractal-based) with real-time behavior.
The fractal-based implementation ensures that add/insertion/deletion operations worst execution time is always in less than O(log(size)). For comparison
is in O(size) due to resize.
Instances of this class can advantageously replace ArrayList, LinkedList or ArrayDeque in terms of adaptability, space or performance. Fast tables can be concurrently iterated / modified through their shared/atomic views. They inherit all the fast collection views and support the subTable view over a portion of the table. [code] FastTable<String> names = new FastTable<String>().addAll("John Deuff", "Otto Graf", "Sim Kamil"); names.sort(Equalities.LEXICAL_CASE_INSENSITIVE); // Sorts the names in place (different from sorted() which returns a sorted view). names.subTable(0, names.size() / 2).clear(); // Removes the first half of the table (see java.util.List.subList specification). names.filtered(str -> str.startsWith("A")).clear(); // Removes all the names starting with "A" (Java 8 notation). names.filtered(str -> str.startsWith("A")).parallel().clear(); // Same as above but performed concurrently. [/code]
As for any fast collection, iterations can be performed using closures. [code] FastTable<Person> persons = ... Person findWithName(final String name) { return persons.filtered(new Predicate<Person>() { public boolean test(Person person) { return (person.getName().equals(name)); } }).any(Person.class); }[/code]
The notation is shorter with Java 8. [code] Person findWithName(String name) { return persons.filtered(person -> person.getName().equals(name)).any(Person.class); }[/code]
FastTable iteration order is the insertion order; specialization may have a different order, for example the iteration order of FastSortedTable is based on the table sorting order.
Definition at line 87 of file FastTable.java.
javolution.util.FastTable< E >.FastTable | ( | ) |
Creates an empty table whose capacity increments/decrements smoothly without large resize operations to best fit the table current size.
Definition at line 101 of file FastTable.java.
javolution.util.FastTable< E >.FastTable | ( | Equality<? super E > | comparator | ) |
Creates an empty table using the specified comparator for element equality.
Definition at line 109 of file FastTable.java.
|
protected |
Creates a fast table backed up by the specified service implementation.
Definition at line 116 of file FastTable.java.
|
inherited |
Adds the specified element to this collection
Reimplemented in javolution.util.internal.collection.FilteredCollectionImpl< E >, javolution.util.internal.collection.SharedCollectionImpl< E >, javolution.util.internal.collection.DistinctCollectionImpl< E >, javolution.util.internal.table.FastTableImpl< E >, javolution.util.internal.collection.AtomicCollectionImpl< E >, javolution.util.internal.table.SubTableImpl< E >, javolution.util.internal.collection.UnmodifiableCollectionImpl< E >, javolution.util.internal.collection.CollectionView< E >, javolution.util.internal.table.sorted.FastSortedTableImpl< E >, javolution.util.internal.table.UnmodifiableTableImpl< E >, javolution.util.FastSortedSet< E >, javolution.util.internal.collection.SortedCollectionImpl< E >, javolution.util.internal.set.sorted.SubSortedSetImpl< E >, javolution.util.internal.table.ReversedTableImpl< E >, javolution.util.internal.collection.ReversedCollectionImpl< E >, javolution.util.internal.collection.ParallelCollectionImpl< E >, and javolution.util.internal.collection.SequentialCollectionImpl< E >.
Definition at line 408 of file FastCollection.java.
void javolution.util.FastTable< E >.add | ( | int | index, |
E | element | ||
) |
Inserts the specified element at the specified position in this table.
Definition at line 182 of file FastTable.java.
Referenced by javolution.xml.XMLReferenceResolver.createReference(), javolution.xml.internal.stream.NamespacesImpl.getPrefixes(), and javolution.test.Perfometer< T >.printDetails().
FastTable<E> javolution.util.FastTable< E >.addAll | ( | E... | elements | ) |
Returns this collection with the specified element added.
elements | the elements to be added. |
Reimplemented from javolution.util.FastCollection< E >.
Reimplemented in javolution.util.FastSortedTable< E >.
Definition at line 428 of file FastTable.java.
FastTable<E> javolution.util.FastTable< E >.addAll | ( | FastCollection<? extends E > | that | ) |
Returns this collection with the specified collection's elements added in sequence.
Reimplemented from javolution.util.FastCollection< E >.
Reimplemented in javolution.util.FastSortedTable< E >.
Definition at line 434 of file FastTable.java.
|
inherited |
Adds all the specified elements to this collection.
Reimplemented in javolution.util.internal.collection.SharedCollectionImpl< E >, javolution.util.internal.collection.AtomicCollectionImpl< E >, and javolution.util.internal.collection.CollectionView< E >.
Definition at line 462 of file FastCollection.java.
boolean javolution.util.FastTable< E >.addAll | ( | final int | index, |
Collection<? extends E > | elements | ||
) |
Inserts all of the elements in the specified collection into this table at the specified position.
Definition at line 190 of file FastTable.java.
Referenced by javolution.xml.internal.stream.EntitiesImpl.setEntitiesMapping().
void javolution.util.FastTable< E >.addFirst | ( | E | element | ) |
Inserts the specified element at the front of this table.
Definition at line 253 of file FastTable.java.
void javolution.util.FastTable< E >.addLast | ( | E | element | ) |
Inserts the specified element at the end of this table.
Definition at line 260 of file FastTable.java.
|
packageinherited |
Returns any non-null element of the specified type (convenience method).
type | the element type searched for. |
Definition at line 515 of file FastCollection.java.
References javolution.util.function.Reducers.any().
FastTable<E> javolution.util.FastTable< E >.atomic | ( | ) |
Returns an atomic view over this collection. All operations that write or access multiple elements in the collection (such as addAll(), retainAll()) are atomic. Iterators on atomic collections are thread-safe (no ConcurrentModificationException possible).
Reimplemented from javolution.util.FastCollection< E >.
Reimplemented in javolution.util.FastSortedTable< E >.
Definition at line 125 of file FastTable.java.
void javolution.util.FastTable< E >.clear | ( | ) |
Removes all elements from this collection.
Reimplemented from javolution.util.FastCollection< E >.
Definition at line 171 of file FastTable.java.
Referenced by javolution.xml.XMLReferenceResolver.reset().
|
inherited |
Returns the comparator uses by this collection for equality and/or ordering if this collection is sorted.
Reimplemented in javolution.util.internal.collection.SharedCollectionImpl< E >, javolution.util.internal.bitset.BitSetServiceImpl, javolution.util.internal.table.FastTableImpl< E >, javolution.util.internal.table.SubTableImpl< E >, javolution.util.internal.collection.AtomicCollectionImpl< E >, javolution.util.internal.collection.SortedCollectionImpl< E >, javolution.util.internal.set.sorted.SubSortedSetImpl< E >, javolution.util.internal.collection.CollectionView< E >, javolution.util.internal.collection.FilteredCollectionImpl< E >, javolution.util.internal.table.UnmodifiableTableImpl< E >, javolution.util.internal.collection.DistinctCollectionImpl< E >, javolution.util.internal.map.MapView< K, V >.EntrySet, javolution.util.internal.table.ReversedTableImpl< E >, javolution.util.internal.collection.ReversedCollectionImpl< E >, javolution.util.internal.collection.UnmodifiableCollectionImpl< E >, javolution.util.internal.collection.ParallelCollectionImpl< E >, and javolution.util.internal.collection.SequentialCollectionImpl< E >.
Definition at line 574 of file FastCollection.java.
Referenced by javolution.util.FastSet< Index >.FastSet(), javolution.util.FastSortedSet< E >.FastSortedSet(), javolution.util.FastSortedTable< E >.FastSortedTable(), and javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.FastTable().
|
inherited |
Indicates if this collection contains the specified element.
Reimplemented in javolution.util.FastSet< E >, javolution.util.FastSortedSet< E >, javolution.util.internal.set.sorted.SubSortedSetImpl< E >, javolution.util.internal.collection.SortedCollectionImpl< E >, javolution.util.FastSortedTable< E >, javolution.util.internal.collection.CollectionView< E >, javolution.util.internal.map.MapView< K, V >.EntrySet, javolution.util.internal.collection.ReversedCollectionImpl< E >, javolution.util.internal.collection.UnmodifiableCollectionImpl< E >, javolution.util.internal.collection.ParallelCollectionImpl< E >, javolution.util.internal.collection.SequentialCollectionImpl< E >, javolution.util.internal.collection.SharedCollectionImpl< E >, javolution.util.internal.collection.AtomicCollectionImpl< E >, javolution.util.internal.collection.FilteredCollectionImpl< E >, javolution.util.internal.collection.DistinctCollectionImpl< E >, javolution.util.internal.table.TableView< E >, javolution.util.internal.set.SetView< E >, and javolution.util.internal.bitset.BitSetServiceImpl.
Definition at line 436 of file FastCollection.java.
|
inherited |
Indicates if this collection contains all the specified elements.
Reimplemented in javolution.util.internal.collection.SharedCollectionImpl< E >, javolution.util.internal.collection.AtomicCollectionImpl< E >, and javolution.util.internal.collection.CollectionView< E >.
Definition at line 469 of file FastCollection.java.
Iterator<E> javolution.util.FastTable< E >.descendingIterator | ( | ) |
Returns an iterator over the elements in this table in reverse sequential order.
Definition at line 404 of file FastTable.java.
|
inherited |
Returns a view exposing only distinct elements (it does not iterate twice over the same elements). Adding elements already in the collection through this view has no effect. If this collection is initially empty, using a distinct view to add new elements ensures that this collection has no duplicate.
Definition at line 293 of file FastCollection.java.
E javolution.util.FastTable< E >.element | ( | ) |
Retrieves, but does not remove, the head of the queue represented by this table.
Definition at line 376 of file FastTable.java.
Referenced by javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.add(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.addFirst(), javolution.util.FastSortedTable< E >.addIfAbsent(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.addLast(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.indexOf(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.lastIndexOf(), javolution.util.FastSortedTable< E >.positionOf(), and javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.set().
|
inherited |
Compares the specified object with this collection for equality. This method follows the Collection#equals(Object) specification if this collection comparator is Equalities#STANDARD (default). Otherwise, only collections using the same comparator can be considered equals.
obj | the object to be compared for equality with this collection |
true
if both collections are considered equals; false
otherwise. Reimplemented in javolution.util.internal.collection.SharedCollectionImpl< E >, javolution.util.internal.collection.AtomicCollectionImpl< E >, and javolution.util.internal.collection.CollectionView< E >.
Definition at line 611 of file FastCollection.java.
|
inherited |
Returns a view exposing only the elements matching the specified filter. Adding elements not matching the specified filter has no effect. If this collection is initially empty, using a filtered view to add new elements ensure that this collection has only elements satisfying the filter predicate.
Reimplemented in javolution.util.FastSet< E >.
Definition at line 250 of file FastCollection.java.
|
inherited |
Iterates over all this collection elements applying the specified consumer (convenience method). Iterations are performed concurrently if the collection is parallel.
consumer | the functional consumer applied to the collection elements. |
Definition at line 346 of file FastCollection.java.
References javolution.util.function.Consumer< T >.accept().
E javolution.util.FastTable< E >.get | ( | int | index | ) |
Returns the element at the specified position in this table.
Definition at line 204 of file FastTable.java.
Referenced by javolution.xml.XMLReferenceResolver.readReference().
E javolution.util.FastTable< E >.getFirst | ( | ) |
Retrieves, but does not remove, the first element of this table.
Definition at line 267 of file FastTable.java.
E javolution.util.FastTable< E >.getLast | ( | ) |
Retrieves, but does not remove, the last element of this table.
Definition at line 274 of file FastTable.java.
|
inherited |
Returns the hash code of this collection. This method follows the Collection#hashCode() specification if this collection comparator is Equalities#STANDARD.
Reimplemented in javolution.util.internal.collection.SharedCollectionImpl< E >, javolution.util.internal.collection.CollectionView< E >, and javolution.util.internal.collection.AtomicCollectionImpl< E >.
Definition at line 625 of file FastCollection.java.
int javolution.util.FastTable< E >.indexOf | ( | Object | element | ) |
Returns the index of the first occurrence of the specified element in this table, or -1 if this table does not contain the element.
Reimplemented in javolution.util.FastSortedTable< E >.
Definition at line 219 of file FastTable.java.
boolean javolution.util.FastTable< E >.isEmpty | ( | ) |
Indicates if this collection is empty.
Reimplemented from javolution.util.FastCollection< E >.
Definition at line 159 of file FastTable.java.
|
inherited |
Returns an iterator over this collection elements. For shared/atomic collections the iterator is immune to concurrent modifications. In other words the elements iterated over may or may not reflect the current state of the collection.
Reimplemented in javolution.util.internal.bitset.BitSetServiceImpl, javolution.util.internal.collection.SharedCollectionImpl< E >, javolution.util.internal.collection.CollectionView< E >, javolution.util.internal.table.FastTableImpl< E >, javolution.util.internal.table.SharedTableImpl< E >, javolution.util.internal.collection.AtomicCollectionImpl< E >, javolution.util.internal.set.sorted.SubSortedSetImpl< E >, javolution.util.internal.table.TableView< E >, javolution.util.internal.collection.SortedCollectionImpl< E >, javolution.util.internal.map.MapView< K, V >.EntrySet, javolution.util.internal.collection.DistinctCollectionImpl< E >, javolution.util.internal.collection.FilteredCollectionImpl< E >, javolution.util.internal.table.AtomicTableImpl< E >, javolution.util.internal.collection.ReversedCollectionImpl< E >, javolution.util.internal.collection.UnmodifiableCollectionImpl< E >, javolution.util.internal.collection.ParallelCollectionImpl< E >, and javolution.util.internal.collection.SequentialCollectionImpl< E >.
Definition at line 455 of file FastCollection.java.
Referenced by javolution.xml.internal.stream.NamespacesImpl.getPrefixes().
int javolution.util.FastTable< E >.lastIndexOf | ( | final Object | element | ) |
Returns the index of the last occurrence of the specified element in this table, or -1 if this table does not contain the element.
Definition at line 227 of file FastTable.java.
ListIterator<E> javolution.util.FastTable< E >.listIterator | ( | ) |
Returns a list iterator over the elements in this table.
Definition at line 234 of file FastTable.java.
ListIterator<E> javolution.util.FastTable< E >.listIterator | ( | int | index | ) |
Returns a list iterator over the elements in this table, starting at the specified position in the table.
Definition at line 242 of file FastTable.java.
|
packageinherited |
Returns a view exposing elements through the specified mapping function. The returned view does not allow new elements to be added.
Definition at line 258 of file FastCollection.java.
Referenced by javolution.xml.internal.stream.EntitiesImpl.setEntitiesMapping().
|
inherited |
Returns the largest element of this collection using this collection comparator (convenience method). Returns
if this collection is empty.
Definition at line 541 of file FastCollection.java.
References javolution.util.function.Reducers.max().
|
inherited |
Returns the smallest element of this collection using this collection comparator (convenience method). Returns
if this collection is empty.
Definition at line 528 of file FastCollection.java.
References javolution.util.function.Reducers.min().
boolean javolution.util.FastTable< E >.offer | ( | E | e | ) |
Inserts the specified element into the queue represented by this table.
Definition at line 355 of file FastTable.java.
boolean javolution.util.FastTable< E >.offerFirst | ( | E | e | ) |
Inserts the specified element at the front of this table.
Definition at line 327 of file FastTable.java.
boolean javolution.util.FastTable< E >.offerLast | ( | E | e | ) |
Inserts the specified element at the end of this table.
Definition at line 334 of file FastTable.java.
|
inherited |
Returns a parallel collection. Parallel collections affect only closure-based operations, all others operations behaving the same. Parallel actions are performed concurrently using Javolution ConcurrentContext. The number of parallel views is derived from the context concurrency (
). Parallel views do not require this collection to be thread-safe (internal synchronization).
Definition at line 222 of file FastCollection.java.
E javolution.util.FastTable< E >.peek | ( | ) |
Retrieves, but does not remove, the head of the queue represented by this table.
Definition at line 383 of file FastTable.java.
E javolution.util.FastTable< E >.peekFirst | ( | ) |
Retrieves, but does not remove, the first element of this table, or returns null if this table is empty.
Definition at line 282 of file FastTable.java.
E javolution.util.FastTable< E >.peekLast | ( | ) |
Retrieves, but does not remove, the last element of this table, or returns null if this table is empty.
Definition at line 290 of file FastTable.java.
|
inherited |
Executes the specified read-only action on this collection. That logic may be performed concurrently on sub-collections if this collection is parallel.
action | the read-only action. |
UnsupportedOperationException | if the action tries to update this collection and this collection is thread-safe. |
ClassCastException | if the action type is not compatible with this collection (e.g. action on set and this is a list). |
Definition at line 315 of file FastCollection.java.
E javolution.util.FastTable< E >.poll | ( | ) |
Retrieves and removes the head of the queue represented by this table.
Definition at line 369 of file FastTable.java.
E javolution.util.FastTable< E >.pollFirst | ( | ) |
Retrieves and removes the first element of this table, or returns null if this table is empty.
Definition at line 298 of file FastTable.java.
E javolution.util.FastTable< E >.pollLast | ( | ) |
Definition at line 305 of file FastTable.java.
E javolution.util.FastTable< E >.pop | ( | ) |
Pops an element from the stack represented by this table.
Definition at line 397 of file FastTable.java.
void javolution.util.FastTable< E >.push | ( | E | e | ) |
Pushes an element onto the stack represented by this table.
Definition at line 390 of file FastTable.java.
|
inherited |
Performs a reduction of the elements of this collection using the specified reducer. This may not involve iterating over all the collection elements, for example the reducers: Reducers#any, Reducers#and and Reducers#or may stop iterating early. Reduction is performed concurrently if this collection is parallel.
reducer | the collection reducer. |
Definition at line 396 of file FastCollection.java.
E javolution.util.FastTable< E >.remove | ( | ) |
Retrieves and removes the head of the queue represented by this table.
Definition at line 362 of file FastTable.java.
E javolution.util.FastTable< E >.remove | ( | int | index | ) |
Removes the element at the specified position in this table.
Definition at line 197 of file FastTable.java.
|
inherited |
Removes the specified element from this collection.
Reimplemented in javolution.util.internal.collection.CollectionView< E >, javolution.util.internal.set.sorted.SubSortedSetImpl< E >, javolution.util.FastSet< E >, javolution.util.internal.map.MapView< K, V >.EntrySet, javolution.util.internal.collection.SortedCollectionImpl< E >, javolution.util.FastSortedSet< E >, javolution.util.internal.collection.ReversedCollectionImpl< E >, javolution.util.FastSortedTable< E >, javolution.util.internal.collection.ParallelCollectionImpl< E >, javolution.util.internal.collection.SequentialCollectionImpl< E >, javolution.util.internal.table.TableView< E >, javolution.util.internal.collection.SharedCollectionImpl< E >, javolution.util.internal.collection.AtomicCollectionImpl< E >, javolution.util.internal.collection.FilteredCollectionImpl< E >, javolution.util.internal.collection.DistinctCollectionImpl< E >, javolution.util.internal.collection.UnmodifiableCollectionImpl< E >, javolution.util.internal.set.SetView< E >, and javolution.util.internal.bitset.BitSetServiceImpl.
Definition at line 443 of file FastCollection.java.
|
inherited |
Removes all the specified element from this collection.
Reimplemented in javolution.util.internal.collection.SharedCollectionImpl< E >, javolution.util.internal.collection.CollectionView< E >, and javolution.util.internal.collection.AtomicCollectionImpl< E >.
Definition at line 476 of file FastCollection.java.
E javolution.util.FastTable< E >.removeFirst | ( | ) |
Retrieves and removes the last element of this table, or returns null if this table is empty.
Definition at line 313 of file FastTable.java.
boolean javolution.util.FastTable< E >.removeFirstOccurrence | ( | Object | o | ) |
Removes the first occurrence of the specified element from this table.
Definition at line 341 of file FastTable.java.
|
inherited |
Removes from this collection all the elements matching the specified functional predicate (convenience method). Removals are performed concurrently if this collection is parallel and atomically if this collection is atomic.
filter | a predicate returning true
|
Definition at line 368 of file FastCollection.java.
E javolution.util.FastTable< E >.removeLast | ( | ) |
Retrieves and removes the last element of this table.
Definition at line 320 of file FastTable.java.
boolean javolution.util.FastTable< E >.removeLastOccurrence | ( | Object | o | ) |
Removes the last occurrence of the specified element from this table.
Definition at line 348 of file FastTable.java.
|
inherited |
Removes all the elements except those in the specified collection.
Reimplemented in javolution.util.internal.collection.SharedCollectionImpl< E >, javolution.util.internal.collection.CollectionView< E >, and javolution.util.internal.collection.AtomicCollectionImpl< E >.
Definition at line 483 of file FastCollection.java.
FastTable<E> javolution.util.FastTable< E >.reversed | ( | ) |
Returns a view exposing elements in reverse iterative order.
Reimplemented from javolution.util.FastCollection< E >.
Definition at line 130 of file FastTable.java.
|
inherited |
Returns a sequential view of this collection. Using this view, all closure-based iterations are performed sequentially.
Definition at line 230 of file FastCollection.java.
|
protected |
Returns the service implementation of this collection (for sub-classes).
Reimplemented from javolution.util.FastCollection< E >.
Reimplemented in javolution.util.FastSortedTable< E >.
Definition at line 449 of file FastTable.java.
|
staticprotectedinherited |
Returns the service implementation of any fast collection (for sub-classes).
Definition at line 647 of file FastCollection.java.
References javolution.util.FastCollection< E >.service().
E javolution.util.FastTable< E >.set | ( | int | index, |
E | element | ||
) |
Replaces the element at the specified position in this table with the specified element.
Definition at line 211 of file FastTable.java.
FastTable<E> javolution.util.FastTable< E >.shared | ( | ) |
Returns a thread-safe view over this collection. The shared view allows for concurrent read as long as there is no writer. The default implementation is based on readers-writers locks giving priority to writers. Iterators on shared collections are thread-safe (no ConcurrentModificationException possible).
Reimplemented from javolution.util.FastCollection< E >.
Reimplemented in javolution.util.FastSortedTable< E >.
Definition at line 135 of file FastTable.java.
Referenced by javolution.xml.internal.stream.XMLInputFactoryImpl.clone(), and javolution.xml.internal.stream.XMLOutputFactoryImpl.clone().
int javolution.util.FastTable< E >.size | ( | ) |
Returns the size of this collection.
Reimplemented from javolution.util.FastCollection< E >.
Definition at line 165 of file FastTable.java.
Referenced by javolution.xml.XMLReferenceResolver.createReference(), and javolution.xml.XMLReferenceResolver.readReference().
void javolution.util.FastTable< E >.sort | ( | ) |
|
inherited |
Returns a view exposing elements sorted according to the collection order.
Definition at line 267 of file FastCollection.java.
Referenced by javolution.util.internal.collection.SortedCollectionImpl< E >.IteratorImpl.IteratorImpl().
|
inherited |
Returns a view exposing elements sorted according to the specified comparator.
Definition at line 275 of file FastCollection.java.
FastTable<E> javolution.util.FastTable< E >.subList | ( | int | fromIndex, |
int | toIndex | ||
) |
Replaced by subTable(int, int). The term "List" for an interface with random access is disturbing !
Definition at line 444 of file FastTable.java.
FastTable<E> javolution.util.FastTable< E >.subTable | ( | int | fromIndex, |
int | toIndex | ||
) |
Returns a view over a portion of the table (equivalent to java.util.List#subList(int, int)).
Definition at line 148 of file FastTable.java.
Referenced by javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.subList().
|
inherited |
Returns an array holding this collection elements.
Reimplemented in javolution.util.internal.collection.SharedCollectionImpl< E >, javolution.util.internal.collection.CollectionView< E >, and javolution.util.internal.collection.AtomicCollectionImpl< E >.
Definition at line 490 of file FastCollection.java.
|
packageinherited |
Returns the specified array holding this collection elements if enough capacity.
Reimplemented in javolution.util.internal.collection.SharedCollectionImpl< E >, javolution.util.internal.collection.CollectionView< E >, and javolution.util.internal.collection.AtomicCollectionImpl< E >.
Definition at line 498 of file FastCollection.java.
|
packageinherited |
Returns an immutable reference over this collection. The immutable value is an unmodifiable view of this collection. The caller must guarantees that the original collection is never going to be updated (e.g. there is no reference left of the original collection).
Definition at line 585 of file FastCollection.java.
|
inherited |
Returns the string representation of this collection using its default format.
Definition at line 634 of file FastCollection.java.
References javolution.text.TextContext.getFormat().
FastTable<E> javolution.util.FastTable< E >.unmodifiable | ( | ) |
Returns an unmodifiable view over this collection. Any attempt to modify the collection through this view will result into a java.lang.UnsupportedOperationException being raised.
Reimplemented from javolution.util.FastCollection< E >.
Reimplemented in javolution.util.FastSortedTable< E >.
Definition at line 140 of file FastTable.java.
|
inherited |
Executes the specified update action on this collection. That logic may be performed concurrently on sub-collections if this collection is parallel. For atomic collections the update is atomic (either concurrent readers see the full result of the action or nothing).
action | the update action. |
ClassCastException | if the action type is not compatible with this collection (e.g. action on set and this is a list). |
Definition at line 334 of file FastCollection.java.
Referenced by javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.sort().
|
staticprivate |
Definition at line 90 of file FastTable.java.
|
private |
Holds the actual service implementation.
Reimplemented in javolution.util.FastSortedTable< E >.
Definition at line 95 of file FastTable.java.
Referenced by javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.add(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.addAll(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.addFirst(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.addLast(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.atomic(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.clear(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.descendingIterator(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.element(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.FastTable(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.get(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.getFirst(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.getLast(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.indexOf(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.isEmpty(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.lastIndexOf(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.listIterator(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.offer(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.offerFirst(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.offerLast(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.peek(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.peekFirst(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.peekLast(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.poll(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.pollFirst(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.pollLast(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.pop(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.push(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.remove(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.removeFirst(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.removeFirstOccurrence(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.removeLast(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.removeLastOccurrence(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.reversed(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.service(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.set(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.shared(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.size(), javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.subTable(), and javolution.util.FastTable< javolution.xml.internal.stream.XMLStreamReaderImpl >.unmodifiable().