public final class FastUnmodifiableCollection extends FastAbstractList implements java.util.List, Reusable
FastCollection.Record| Constructor | Description |
|---|---|
FastUnmodifiableCollection(FastAbstractList inner) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
add(int index,
java.lang.Object element) |
|
boolean |
add(java.lang.Object element) |
Appends the specified value to the end of this collection
(optional operation).
|
boolean |
addAll(java.util.Collection c) |
Appends all of the values in the specified collection to the end of
this collection, in the order that they are returned by the specified
collection's iterator.
|
boolean |
addAll(int index,
java.util.Collection c) |
|
void |
clear() |
Removes all of the values from this collection (optional operation).
|
boolean |
contains(java.lang.Object value) |
Indicates if this collection contains the specified value.
|
boolean |
containsAll(java.util.Collection c) |
Indicates if this collection contains all of the values of the
specified collection.
|
void |
delete(FastCollection.Record record) |
Deletes the specified record from this collection.
|
java.lang.Object |
get(int index) |
|
FastCollection.Record |
head() |
Returns the head record of this collection; it is the record such as
head().getNext() holds the first collection value. |
int |
indexOf(java.lang.Object o) |
|
boolean |
isEmpty() |
Indicates if this collection is empty.
|
java.util.Iterator |
iterator() |
Returns an iterator over the elements in this collection
(allocated on the stack when executed in a
StackContext). |
int |
lastIndexOf(java.lang.Object o) |
|
java.util.ListIterator |
listIterator() |
|
java.util.ListIterator |
listIterator(int index) |
|
java.lang.Object |
remove(int index) |
|
boolean |
remove(java.lang.Object value) |
Removes the first occurrence in this collection of the specified value
(optional operation).
|
boolean |
removeAll(java.util.Collection c) |
Removes from this collection all the values that are contained in the
specified collection.
|
void |
reset() |
Resets the internal state of this object to its default values.
|
boolean |
retainAll(java.util.Collection c) |
Retains only the values in this collection that are contained in the
specified collection.
|
java.lang.Object |
set(int index,
java.lang.Object element) |
|
int |
size() |
Returns the number of values in this collection.
|
java.util.List |
subList(int fromIndex,
int toIndex) |
|
FastCollection.Record |
tail() |
Returns the tail record of this collection; it is the record such as
tail().getPrevious() holds the last collection value. |
java.lang.Object[] |
toArray() |
Returns a new array allocated on the heap containing all of the values
in this collection in proper sequence.
|
java.lang.Object[] |
toArray(java.lang.Object[] array) |
Fills the specified array with the values of this collection in
the proper sequence.
|
java.lang.Object |
valueOf(FastCollection.Record record) |
Returns the collection value for the specified record.
|
shared, unmodifiableequals, getValueComparator, hashCode, toString, toTextpublic FastUnmodifiableCollection(FastAbstractList inner)
public boolean add(java.lang.Object element)
FastCollectionNote: This default implementation always throws
UnsupportedOperationException.
add in interface java.util.Collectionadd in interface java.util.Listadd in class FastAbstractListelement - the value to be appended to this collection.true (as per the general contract of the
Collection.add method).public void add(int index,
java.lang.Object element)
add in interface java.util.Listadd in class FastAbstractListpublic boolean addAll(java.util.Collection c)
FastCollectionaddAll in interface java.util.CollectionaddAll in interface java.util.ListaddAll in class FastAbstractListc - collection whose values are to be added to this collection.true if this collection changed as a result of
the call; false otherwise.public boolean addAll(int index,
java.util.Collection c)
addAll in interface java.util.ListaddAll in class FastAbstractListpublic void clear()
FastCollectionclear in interface java.util.Collectionclear in interface java.util.Listclear in class FastAbstractListpublic boolean contains(java.lang.Object value)
FastCollectioncontains in interface java.util.Collectioncontains in interface java.util.Listcontains in class FastAbstractListvalue - the value whose presence in this collection
is to be tested.true if this collection contains the specified
value;false otherwise.public boolean containsAll(java.util.Collection c)
FastCollectioncontainsAll in interface java.util.CollectioncontainsAll in interface java.util.ListcontainsAll in class FastCollectionc - collection to be checked for containment in this collection.true if this collection contains all of the values
of the specified collection; false otherwise.public void delete(FastCollection.Record record)
FastCollectionImplementation must ensure that removing a record from the collection does not affect in any way the records preceding the record being removed (it might affect the next records though, e.g. in a list collection, the indices of the subsequent records will change).
delete in class FastAbstractListrecord - the record to be removed.public java.lang.Object get(int index)
get in interface java.util.Listget in class FastAbstractListpublic FastCollection.Record head()
FastCollectionhead().getNext() holds the first collection value.head in class FastAbstractListpublic int indexOf(java.lang.Object o)
indexOf in interface java.util.ListindexOf in class FastAbstractListpublic boolean isEmpty()
FastCollectionisEmpty in interface java.util.CollectionisEmpty in interface java.util.ListisEmpty in class FastAbstractListtrue if this collection contains no value;
false otherwise.public java.util.Iterator iterator()
FastCollectionStackContext).iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Listiterator in class FastAbstractListpublic int lastIndexOf(java.lang.Object o)
lastIndexOf in interface java.util.ListlastIndexOf in class FastAbstractListpublic java.util.ListIterator listIterator()
listIterator in interface java.util.ListlistIterator in class FastAbstractListpublic java.util.ListIterator listIterator(int index)
listIterator in interface java.util.ListlistIterator in class FastAbstractListpublic java.lang.Object remove(int index)
remove in interface java.util.Listremove in class FastAbstractListpublic boolean remove(java.lang.Object value)
FastCollectionremove in interface java.util.Collectionremove in interface java.util.Listremove in class FastAbstractListvalue - the value to be removed from this collection.true if this collection contained the specified
value; false otherwise.public boolean removeAll(java.util.Collection c)
FastCollectionremoveAll in interface java.util.CollectionremoveAll in interface java.util.ListremoveAll in class FastCollectionc - collection that defines which values will be removed from
this collection.true if this collection changed as a result of
the call; false otherwise.public void reset()
Reusablepublic boolean retainAll(java.util.Collection c)
FastCollectionretainAll in interface java.util.CollectionretainAll in interface java.util.ListretainAll in class FastCollectionc - collection that defines which values this set will retain.true if this collection changed as a result of
the call; false otherwise.public java.lang.Object set(int index,
java.lang.Object element)
set in interface java.util.Listset in class FastAbstractListpublic int size()
FastCollectionsize in interface java.util.Collectionsize in interface java.util.Listsize in class FastAbstractListpublic java.util.List subList(int fromIndex,
int toIndex)
subList in interface java.util.ListsubList in class FastAbstractListpublic FastCollection.Record tail()
FastCollectiontail().getPrevious() holds the last collection value.tail in class FastAbstractListpublic java.lang.Object[] toArray()
FastCollection Note: To avoid heap allocation FastCollection.toArray(Object[]) is
recommended.
toArray in interface java.util.CollectiontoArray in interface java.util.ListtoArray in class FastCollectiontoArray(new Object[size()])public java.lang.Object[] toArray(java.lang.Object[] array)
FastCollectionNote: Unlike standard Collection, this method does not try to resize the array using reflection (which might not be supported) if the array is too small. UnsupportedOperationException is raised if the specified array is too small for this collection.
toArray in interface java.util.CollectiontoArray in interface java.util.ListtoArray in class FastCollectionarray - the array into which the values of this collection
are to be stored.public java.lang.Object valueOf(FastCollection.Record record)
FastCollectionvalueOf in class FastAbstractListrecord - the record whose current value is returned.Copyright © 2005 - 2009 Javolution.