protected static class AbstractMutableList.SubList<T> extends AbstractMutableList<T> implements java.io.Serializable, java.util.RandomAccess
AbstractMutableList.SubList<T>| Modifier | Constructor and Description |
|---|---|
protected |
AbstractMutableList.SubList(AbstractMutableList<T> list,
int fromIndex,
int toIndex) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
T element) |
boolean |
add(T o) |
boolean |
addAll(java.util.Collection<? extends T> collection) |
boolean |
addAll(int index,
java.util.Collection<? extends T> collection) |
void |
clear() |
com.gs.collections.api.list.MutableList<T> |
clone() |
<P> void |
forEachWith(com.gs.collections.api.block.procedure.Procedure2<? super T,? super P> procedure,
P parameter)
The procedure2 is evaluated for each element in the iterable with the specified parameter provided
as the second argument.
|
void |
forEachWithIndex(com.gs.collections.api.block.procedure.primitive.ObjectIntProcedure<? super T> objectIntProcedure)
Iterates over the iterable passing each element and the current relative int index to the specified instance of
ObjectIntProcedure.
|
T |
get(int index)
Returns the item at the specified position in this list iterable.
|
T |
getFirst()
Returns the first element of an iterable.
|
T |
getLast()
Returns the last element of an iterable.
|
java.util.Iterator<T> |
iterator() |
java.util.ListIterator<T> |
listIterator(int index) |
T |
remove(int index) |
T |
set(int index,
T element) |
int |
size()
Returns the number of items in this iterable.
|
com.gs.collections.api.list.MutableList<T> |
subList(int fromIndex,
int toIndex) |
com.gs.collections.api.list.MutableList<T> |
toReversed()
Returns a new MutableList in reverse order
|
com.gs.collections.api.stack.MutableStack<T> |
toStack()
Converts the list to a mutable MutableStack implementation.
|
protected java.lang.Object |
writeReplace() |
allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, asParallel, asReversed, asSynchronized, asUnmodifiable, binarySearch, binarySearch, collect, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectIf, collectInt, collectLong, collectShort, collectWith, collectWith, contains, containsAll, corresponds, count, countWith, defaultSort, detect, detectIfNone, detectIndex, detectLastIndex, detectWith, detectWithIfNone, distinct, distinct, drop, dropWhile, each, equals, flatCollect, flatCollect, forEach, forEachWithIndex, groupBy, groupByEach, groupByUniqueKey, hashCode, indexOf, injectInto, injectInto, injectInto, injectInto, injectIntoWith, lastIndexOf, listIterator, max, max, maxBy, min, min, minBy, newEmpty, noneSatisfy, noneSatisfyWith, partition, partitionWhile, partitionWith, reject, reject, rejectWith, rejectWith, removeAll, removeIf, removeIfWith, retainAll, reverseForEach, reverseThis, select, select, selectAndRejectWith, selectInstancesOf, selectWith, selectWith, shuffleThis, shuffleThis, sortThis, sortThis, sortThisBy, sortThisByBoolean, sortThisByByte, sortThisByChar, sortThisByDouble, sortThisByFloat, sortThisByInt, sortThisByLong, sortThisByShort, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, take, takeWhile, tap, toImmutable, toList, toSet, toSortedList, toSortedList, with, withAll, without, withoutAll, zip, zip, zipWithIndex, zipWithIndexaddAllIterable, aggregateBy, aggregateInPlaceBy, chunk, remove, removeAllIterable, retainAllIterableappendString, asLazy, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAllArguments, containsAllIterable, forEach, groupBy, groupByEach, groupByUniqueKey, injectInto, isEmpty, makeString, makeString, makeString, notEmpty, sumByDouble, sumByFloat, sumByInt, sumByLong, toArray, toArray, toBag, toMap, toSortedBag, toSortedBag, toSortedBagBy, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitaddAllIterable, aggregateBy, aggregateInPlaceBy, removeAllIterable, retainAllIterableappendString, asLazy, chunk, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAllArguments, containsAllIterable, groupBy, groupByEach, groupByUniqueKey, injectInto, isEmpty, makeString, makeString, makeString, notEmpty, sumByDouble, sumByFloat, sumByInt, sumByLong, toArray, toArray, toBag, toMap, toSortedBag, toSortedBag, toSortedBagBy, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, toStringprotected AbstractMutableList.SubList(AbstractMutableList<T> list, int fromIndex, int toIndex)
public com.gs.collections.api.list.MutableList<T> toReversed()
com.gs.collections.api.list.MutableListtoReversed in interface com.gs.collections.api.list.ListIterable<T>toReversed in interface com.gs.collections.api.list.MutableList<T>toReversed in interface com.gs.collections.api.ordered.ReversibleIterable<T>toReversed in class AbstractMutableList<T>protected java.lang.Object writeReplace()
public boolean add(T o)
add in interface java.util.Collection<T>add in interface java.util.List<T>add in class AbstractMutableCollection<T>public T get(int index)
com.gs.collections.api.list.ListIterablepublic int size()
com.gs.collections.api.RichIterablepublic void clear()
public boolean addAll(java.util.Collection<? extends T> collection)
addAll in interface java.util.Collection<T>addAll in interface java.util.List<T>addAll in class AbstractMutableCollection<T>public boolean addAll(int index,
java.util.Collection<? extends T> collection)
addAll in interface java.util.List<T>public java.util.Iterator<T> iterator()
public java.util.ListIterator<T> listIterator(int index)
listIterator in interface com.gs.collections.api.list.ListIterable<T>listIterator in interface java.util.List<T>listIterator in class AbstractMutableList<T>List.listIterator(int)public com.gs.collections.api.list.MutableList<T> subList(int fromIndex, int toIndex)
subList in interface com.gs.collections.api.list.MutableList<T>subList in interface java.util.List<T>subList in class AbstractMutableList<T>public com.gs.collections.api.list.MutableList<T> clone()
clone in interface com.gs.collections.api.list.MutableList<T>clone in class AbstractMutableList<T>public T getFirst()
com.gs.collections.api.RichIterableThe order of Sets are not guaranteed (except for TreeSets and other Ordered Set implementations), so if you use this method, the first element could be any element from the Set.
public T getLast()
com.gs.collections.api.RichIterableThe order of Sets are not guaranteed (except for TreeSets and other Ordered Set implementations), so if you use this method, the last element could be any element from the Set.
public com.gs.collections.api.stack.MutableStack<T> toStack()
com.gs.collections.api.list.ListIterabletoStack in interface com.gs.collections.api.list.ListIterable<T>toStack in interface com.gs.collections.api.ordered.OrderedIterable<T>toStack in class AbstractMutableList<T>public void forEachWithIndex(com.gs.collections.api.block.procedure.primitive.ObjectIntProcedure<? super T> objectIntProcedure)
com.gs.collections.api.InternalIterableExample using a Java 8 lambda:
people.forEachWithIndex((Person person, int index) -> LOGGER.info("Index: " + index + " person: " + person.getName()));
Example using an anonymous inner class:
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<T>forEachWithIndex in interface com.gs.collections.api.ordered.OrderedIterable<T>forEachWithIndex in class AbstractMutableList<T>public <P> void forEachWith(com.gs.collections.api.block.procedure.Procedure2<? super T,? super P> procedure, P parameter)
com.gs.collections.api.InternalIterableExample using a Java 8 lambda:
people.forEachWith((Person person, Person other) ->
{
if (person.isRelatedTo(other))
{
LOGGER.info(person.getName());
}
}, fred);
Example using an anonymous inner class:
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<T>forEachWith in class AbstractMutableList<T>