public final class CompositeFastList<E> extends AbstractMutableList<E> implements 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)
Constructor and Description |
---|
CompositeFastList() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(E object) |
void |
add(int index,
E element) |
boolean |
addAll(Collection<? extends E> collection) |
boolean |
addAll(int index,
Collection<? extends E> collection) |
void |
addComposited(Collection<? extends E> collection) |
void |
clear() |
MutableList<E> |
clone() |
boolean |
contains(Object object)
Returns true if the iterable has an element which responds true to element.equals(object).
|
boolean |
containsAll(Collection<?> collection)
Returns true if all elements in source are contained in this collection.
|
boolean |
equals(Object other)
Follows the same general contract as
List.equals(Object) . |
void |
forEach(int fromIndex,
int toIndex,
Procedure<? super E> procedure)
Iterates over the section of the list covered by the specified inclusive indexes.
|
void |
forEach(Procedure<? super E> procedure)
The procedure is executed for each element in the iterable.
|
<P> void |
forEachWith(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,
ObjectIntProcedure<? super E> objectIntProcedure)
Iterates over the section of the list covered by the specified inclusive indexes.
|
void |
forEachWithIndex(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(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.
|
Iterator<E> |
iterator() |
int |
lastIndexOf(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.
|
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).
|
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(Object object) |
boolean |
removeAll(Collection<?> collection) |
boolean |
retainAll(Collection<?> collection) |
void |
reverseForEach(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.
|
Object[] |
toArray()
Converts this iterable to an array.
|
Object[] |
toArray(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, zipWithIndex
addAllIterable, aggregateBy, aggregateInPlaceBy, chunk, removeAllIterable, retainAllIterable
appendString, 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, zipWithIndex
addAllIterable, aggregateBy, aggregateInPlaceBy, removeAllIterable, retainAllIterable
replaceAll, sort, spliterator
parallelStream, removeIf, stream
appendString, 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, zipWithIndex
public MutableList<E> clone()
clone
in interface MutableList<E>
clone
in class AbstractMutableList<E>
public int size()
RichIterable
size
in interface RichIterable<E>
size
in interface Collection<E>
size
in interface List<E>
public CompositeFastList<E> reverseThis()
MutableList
reverseThis
in interface MutableList<E>
reverseThis
in class AbstractMutableList<E>
public void forEach(Procedure<? super E> procedure)
InternalIterable
e.g. people.forEach(new Procedure() { public void value(Person person) { LOGGER.info(person.getName()); } });
forEach
in interface InternalIterable<E>
forEach
in class AbstractMutableList<E>
public void forEachWithIndex(ObjectIntProcedure<? super E> objectIntProcedure)
InternalIterable
e.g. people.forEachWithIndex(new ObjectIntProcedure() { public void value(Person person, int index) { LOGGER.info("Index: " + index + " person: " + person.getName()); } });
forEachWithIndex
in interface InternalIterable<E>
forEachWithIndex
in class AbstractMutableList<E>
public void reverseForEach(Procedure<? super E> procedure)
ReversibleIterable
e.g. people.reverseForEach(new Procedure() { public void value(Person person) { LOGGER.info(person.getName()); } });
reverseForEach
in interface ReversibleIterable<E>
reverseForEach
in class AbstractMutableList<E>
public void forEach(int fromIndex, int toIndex, Procedure<? super E> procedure)
ListIterable
e.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 ListIterable<E>
forEach
in class AbstractMutableList<E>
public void forEachWithIndex(int fromIndex, int toIndex, ObjectIntProcedure<? super E> objectIntProcedure)
ListIterable
e.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 ListIterable<E>
forEachWithIndex
in class AbstractMutableList<E>
public <P> void forEachWith(Procedure2<? super E,? super P> procedure2, P parameter)
InternalIterable
e.g. people.forEachWith(new Procedure2() { public void value(Person person, Person other) { if (person.isRelatedTo(other)) { LOGGER.info(person.getName()); } } }, fred);
forEachWith
in interface InternalIterable<E>
forEachWith
in class AbstractMutableList<E>
public boolean isEmpty()
RichIterable
isEmpty
in interface RichIterable<E>
isEmpty
in interface Collection<E>
isEmpty
in interface List<E>
isEmpty
in class AbstractRichIterable<E>
public boolean contains(Object object)
RichIterable
contains
in interface RichIterable<E>
contains
in interface Collection<E>
contains
in interface List<E>
contains
in class AbstractMutableList<E>
public Object[] toArray()
RichIterable
toArray
in interface RichIterable<E>
toArray
in interface Collection<E>
toArray
in interface List<E>
toArray
in class AbstractRichIterable<E>
Collection.toArray()
public boolean add(E object)
add
in interface Collection<E>
add
in interface List<E>
add
in class AbstractMutableCollection<E>
public boolean remove(Object object)
remove
in interface Collection<E>
remove
in interface List<E>
remove
in class AbstractMutableCollection<E>
public boolean addAll(Collection<? extends E> collection)
addAll
in interface Collection<E>
addAll
in interface List<E>
addAll
in class AbstractMutableCollection<E>
public boolean containsAll(Collection<?> collection)
RichIterable
containsAll
in interface RichIterable<E>
containsAll
in interface Collection<E>
containsAll
in interface List<E>
containsAll
in class AbstractMutableList<E>
Collection.containsAll(Collection)
public Object[] toArray(Object[] array)
RichIterable
toArray
in interface RichIterable<E>
toArray
in interface Collection<E>
toArray
in interface List<E>
toArray
in class AbstractRichIterable<E>
Collection.toArray(Object[])
public void addComposited(Collection<? extends E> collection)
public boolean addAll(int index, Collection<? extends E> collection)
public void clear()
public boolean retainAll(Collection<?> collection)
retainAll
in interface Collection<E>
retainAll
in interface List<E>
retainAll
in class AbstractMutableList<E>
public boolean removeAll(Collection<?> collection)
removeAll
in interface Collection<E>
removeAll
in interface List<E>
removeAll
in class AbstractMutableList<E>
public E get(int index)
ListIterable
public int indexOf(Object o)
ReversibleIterable
indexOf
in interface ReversibleIterable<E>
indexOf
in interface List<E>
indexOf
in class AbstractMutableList<E>
public int lastIndexOf(Object o)
ListIterable
lastIndexOf
in interface ListIterable<E>
lastIndexOf
in interface List<E>
lastIndexOf
in class AbstractMutableList<E>
public ListIterator<E> listIterator()
listIterator
in interface ListIterable<E>
listIterator
in interface List<E>
listIterator
in class AbstractMutableList<E>
List.listIterator()
public ListIterator<E> listIterator(int index)
listIterator
in interface ListIterable<E>
listIterator
in interface List<E>
listIterator
in class AbstractMutableList<E>
List.listIterator(int)
public boolean equals(Object other)
ListIterable
List.equals(Object)
.equals
in interface ListIterable<E>
equals
in interface Collection<E>
equals
in interface List<E>
equals
in class AbstractMutableList<E>
public int hashCode()
ListIterable
List.hashCode()
.hashCode
in interface ListIterable<E>
hashCode
in interface Collection<E>
hashCode
in interface List<E>
hashCode
in class AbstractMutableList<E>
Copyright © 2004–2018. All rights reserved.