public final class CompositeFastList<E> extends AbstractMutableList<E> implements java.io.Serializable
Note: mutation operations (e.g. add and remove, sorting) will change the underlying lists - so be sure to only use a composite list where it will be the only reference to the sublists (for example, a composite list which contains multiple query results is OK as long as it is the only thing that references the lists)
AbstractMutableList.SubList<T>| Constructor and Description |
|---|
CompositeFastList() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E object) |
void |
add(int index,
E element) |
boolean |
addAll(java.util.Collection<? extends E> collection) |
boolean |
addAll(int index,
java.util.Collection<? extends E> collection) |
void |
addComposited(java.util.Collection<? extends E> collection) |
void |
clear() |
com.gs.collections.api.list.MutableList<E> |
clone() |
boolean |
contains(java.lang.Object object)
Returns true if the iterable has an element which responds true to element.equals(object).
|
boolean |
containsAll(java.util.Collection<?> collection)
Returns true if all elements in source are contained in this collection.
|
protected void |
defaultSort(java.util.Comparator<? super E> comparator)
Override in subclasses where it can be optimized.
|
boolean |
equals(java.lang.Object other)
Follows the same general contract as
List.equals(Object). |
void |
forEach(int fromIndex,
int toIndex,
com.gs.collections.api.block.procedure.Procedure<? super E> procedure)
Iterates over the section of the list covered by the specified inclusive indexes.
|
void |
forEach(com.gs.collections.api.block.procedure.Procedure<? super E> procedure)
The procedure is executed for each element in the iterable.
|
<P> void |
forEachWith(com.gs.collections.api.block.procedure.Procedure2<? super E,? super P> procedure2,
P parameter)
The procedure2 is evaluated for each element in the iterable with the specified parameter provided
as the second argument.
|
void |
forEachWithIndex(int fromIndex,
int toIndex,
com.gs.collections.api.block.procedure.primitive.ObjectIntProcedure<? super E> objectIntProcedure)
Iterates over the section of the list covered by the specified inclusive indexes.
|
void |
forEachWithIndex(com.gs.collections.api.block.procedure.primitive.ObjectIntProcedure<? super E> objectIntProcedure)
Iterates over the iterable passing each element and the current relative int index to the specified instance of
ObjectIntProcedure
|
E |
get(int index)
Returns the item at the specified position in this list iterable.
|
int |
hashCode()
Follows the same general contract as
List.hashCode(). |
int |
indexOf(java.lang.Object o)
Returns the index of the first occurrence of the specified item
in this list, or -1 if this list does not contain the item.
|
boolean |
isEmpty()
Returns true if this iterable has zero items.
|
java.util.Iterator<E> |
iterator() |
int |
lastIndexOf(java.lang.Object o)
Returns the index of the last occurrence of the specified item
in this list, or -1 if this list does not contain the item.
|
java.util.ListIterator<E> |
listIterator()
a list iterator is a problem for a composite list as going back in the order of the list is an issue,
as are the other methods like set() and add() (and especially, remove).
|
java.util.ListIterator<E> |
listIterator(int index)
a llst iterator is a problem for a composite list as going back in the order of the list is an issue,
as are the other methods like set() and add() (and especially, remove).
|
E |
remove(int index) |
boolean |
remove(java.lang.Object object) |
boolean |
removeAll(java.util.Collection<?> collection) |
boolean |
retainAll(java.util.Collection<?> collection) |
void |
reverseForEach(com.gs.collections.api.block.procedure.Procedure<? super E> procedure)
Evaluates the procedure for each element of the list iterating in reverse order.
|
CompositeFastList<E> |
reverseThis()
Mutates the current list by reversing its order and returns the current list as a result
|
E |
set(int index,
E element) |
int |
size()
Returns the number of items in this iterable.
|
java.lang.Object[] |
toArray()
Converts this iterable to an array.
|
java.lang.Object[] |
toArray(java.lang.Object[] array)
Converts this iterable to an array using the specified target array, assuming the target array is as long
or longer than the iterable.
|
allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, asReversed, asSynchronized, asUnmodifiable, binarySearch, binarySearch, collect, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectIf, collectInt, collectLong, collectShort, collectWith, collectWith, count, countWith, detect, detectIfNone, detectWith, detectWithIfNone, distinct, dropWhile, flatCollect, flatCollect, getFirst, getLast, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectIntoWith, max, max, maxBy, min, min, minBy, newEmpty, noneSatisfy, noneSatisfyWith, partition, partitionWhile, partitionWith, reject, reject, rejectWith, rejectWith, removeIf, removeIfWith, select, select, selectAndRejectWith, selectInstancesOf, selectWith, selectWith, sortThis, sortThis, sortThisBy, subList, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, takeWhile, toImmutable, toList, toReversed, toSet, toSortedList, toSortedList, toStack, with, withAll, without, withoutAll, zip, zipWithIndexaddAllIterable, aggregateBy, aggregateInPlaceBy, chunk, removeAllIterable, retainAllIterableappendString, appendString, asLazy, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAllArguments, containsAllIterable, groupBy, groupByEach, injectInto, makeString, makeString, makeString, notEmpty, toBag, toMap, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndexfinalize, getClass, notify, notifyAll, wait, wait, waitaddAllIterable, aggregateBy, aggregateInPlaceBy, removeAllIterable, retainAllIterableappendString, appendString, asLazy, chunk, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAllArguments, containsAllIterable, groupBy, groupByEach, injectInto, makeString, makeString, makeString, notEmpty, toBag, toMap, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndexpublic com.gs.collections.api.list.MutableList<E> clone()
clone in interface com.gs.collections.api.list.MutableList<E>clone in class AbstractMutableList<E>public int size()
com.gs.collections.api.RichIterablepublic CompositeFastList<E> reverseThis()
com.gs.collections.api.list.MutableListreverseThis in interface com.gs.collections.api.list.MutableList<E>reverseThis in class AbstractMutableList<E>public void forEach(com.gs.collections.api.block.procedure.Procedure<? super E> procedure)
com.gs.collections.api.InternalIterablee.g. people.forEach(new Procedure() { public void value(Person person) { LOGGER.info(person.getName()); } });
forEach in interface com.gs.collections.api.InternalIterable<E>forEach in class AbstractMutableList<E>public void forEachWithIndex(com.gs.collections.api.block.procedure.primitive.ObjectIntProcedure<? super E> objectIntProcedure)
com.gs.collections.api.InternalIterablee.g. people.forEachWithIndex(new ObjectIntProcedure() { public void value(Person person, int index) { LOGGER.info("Index: " + index + " person: " + person.getName()); } });
forEachWithIndex in interface com.gs.collections.api.InternalIterable<E>forEachWithIndex in class AbstractMutableList<E>public void reverseForEach(com.gs.collections.api.block.procedure.Procedure<? super E> procedure)
com.gs.collections.api.ordered.ReversibleIterablee.g. people.reverseForEach(new Procedure() { public void value(Person person) { LOGGER.info(person.getName()); } });
reverseForEach in interface com.gs.collections.api.ordered.ReversibleIterable<E>reverseForEach in class AbstractMutableList<E>public void forEach(int fromIndex,
int toIndex,
com.gs.collections.api.block.procedure.Procedure<? super E> procedure)
com.gs.collections.api.list.ListIterablee.g. ListIterableThis code would output ted and mary's names.people = FastList.newListWith(ted, mary, bob, sally) people.forEach(0, 1, new Procedure () { public void value(Person person) { LOGGER.info(person.getName()); } });
forEach in interface com.gs.collections.api.list.ListIterable<E>forEach in class AbstractMutableList<E>public void forEachWithIndex(int fromIndex,
int toIndex,
com.gs.collections.api.block.procedure.primitive.ObjectIntProcedure<? super E> objectIntProcedure)
com.gs.collections.api.list.ListIterablee.g. ListIterableThis code would output ted and mary's names.people = FastList.newListWith(ted, mary, bob, sally) people.forEachWithIndex(0, 1, new ObjectIntProcedure () { public void value(Person person, int index) { LOGGER.info(person.getName()); } });
forEachWithIndex in interface com.gs.collections.api.list.ListIterable<E>forEachWithIndex in class AbstractMutableList<E>public <P> void forEachWith(com.gs.collections.api.block.procedure.Procedure2<? super E,? super P> procedure2, P parameter)
com.gs.collections.api.InternalIterablee.g. people.forEachWith(new Procedure2() { public void value(Person person, Person other) { if (person.isRelatedTo(other)) { LOGGER.info(person.getName()); } } }, fred);
forEachWith in interface com.gs.collections.api.InternalIterable<E>forEachWith in class AbstractMutableList<E>public boolean isEmpty()
com.gs.collections.api.RichIterablepublic boolean contains(java.lang.Object object)
com.gs.collections.api.RichIterablepublic java.util.Iterator<E> iterator()
public java.lang.Object[] toArray()
com.gs.collections.api.RichIterablepublic boolean add(E object)
add in interface java.util.Collection<E>add in interface java.util.List<E>add in class AbstractMutableCollection<E>public boolean remove(java.lang.Object object)
remove in interface java.util.Collection<E>remove in interface java.util.List<E>remove in class AbstractMutableCollection<E>public boolean addAll(java.util.Collection<? extends E> collection)
addAll in interface java.util.Collection<E>addAll in interface java.util.List<E>addAll in class AbstractMutableCollection<E>public boolean containsAll(java.util.Collection<?> collection)
com.gs.collections.api.RichIterablecontainsAll in interface com.gs.collections.api.RichIterable<E>containsAll in interface java.util.Collection<E>containsAll in interface java.util.List<E>containsAll in class AbstractMutableList<E>Collection.containsAll(Collection)public java.lang.Object[] toArray(java.lang.Object[] array)
com.gs.collections.api.RichIterablepublic void addComposited(java.util.Collection<? extends E> collection)
public boolean addAll(int index,
java.util.Collection<? extends E> collection)
addAll in interface java.util.List<E>public void clear()
public boolean retainAll(java.util.Collection<?> collection)
retainAll in interface java.util.Collection<E>retainAll in interface java.util.List<E>retainAll in class AbstractMutableList<E>public boolean removeAll(java.util.Collection<?> collection)
removeAll in interface java.util.Collection<E>removeAll in interface java.util.List<E>removeAll in class AbstractMutableList<E>public E get(int index)
com.gs.collections.api.list.ListIterablepublic int indexOf(java.lang.Object o)
com.gs.collections.api.ordered.ReversibleIterableindexOf in interface com.gs.collections.api.ordered.ReversibleIterable<E>indexOf in interface java.util.List<E>indexOf in class AbstractMutableList<E>public int lastIndexOf(java.lang.Object o)
com.gs.collections.api.list.ListIterablelastIndexOf in interface com.gs.collections.api.list.ListIterable<E>lastIndexOf in interface java.util.List<E>lastIndexOf in class AbstractMutableList<E>public java.util.ListIterator<E> listIterator()
listIterator in interface com.gs.collections.api.list.ListIterable<E>listIterator in interface java.util.List<E>listIterator in class AbstractMutableList<E>List.listIterator()public java.util.ListIterator<E> listIterator(int index)
listIterator in interface com.gs.collections.api.list.ListIterable<E>listIterator in interface java.util.List<E>listIterator in class AbstractMutableList<E>List.listIterator(int)protected void defaultSort(java.util.Comparator<? super E> comparator)
defaultSort in class AbstractMutableList<E>public boolean equals(java.lang.Object other)
com.gs.collections.api.list.ListIterableList.equals(Object).public int hashCode()
com.gs.collections.api.list.ListIterableList.hashCode().