Top Description Methods
org.eclipse.collections.api.list

public Interface FixedSizeList<T>

extends MutableList<T>, FixedSizeCollection<T>
Imports
java.util.Comparator, org.eclipse.collections.api.block.procedure.Procedure, org.eclipse.collections.api.collection.FixedSizeCollection

A FixedSizeList is a list that may be mutated, but cannot grow or shrink in size. The typical mutation allowed for a FixedSizeList implementation is a working implementation for set(int, T). This will allow the FixedSizeList to be sorted.

Method Summary

Modifier and TypeMethod and Description
public default FixedSizeList<T>
sortThis(Comparator<? super T> comparator)

Overrides default org.eclipse.collections.api.list.MutableList.sortThis.

Sorts the internal data structure of this list and returns the list itself as a convenience.

public default FixedSizeList<T>
sortThis()

Overrides default org.eclipse.collections.api.list.MutableList.sortThis.

Sorts the internal data structure of this list and returns the list itself as a convenience.

public FixedSizeList<T>
tap(Procedure<? super T> procedure)

Redeclares org.eclipse.collections.api.collection.FixedSizeCollection.tap.

Redeclares as abstract: org.eclipse.collections.api.list.MutableList.tap.

Executes the Procedure for each element in the iterable and returns this.

public FixedSizeList<T>
toReversed()

Redeclares as abstract: org.eclipse.collections.api.list.MutableList.toReversed.

Returns a new MutableList in reverse order.

public MutableList<T>
with(T element)

Redeclares org.eclipse.collections.api.collection.FixedSizeCollection.with.

Redeclares as abstract: org.eclipse.collections.api.list.MutableList.with.

This method allows fixed size collections the ability to add elements to their existing elements.

public MutableList<T>
withAll(Iterable<? extends T> elements)

Redeclares org.eclipse.collections.api.collection.FixedSizeCollection.withAll.

Redeclares as abstract: org.eclipse.collections.api.list.MutableList.withAll.

This method allows fixed size collections the ability to add multiple elements to their existing elements.

public MutableList<T>
without(T element)

Redeclares org.eclipse.collections.api.collection.FixedSizeCollection.without.

Redeclares as abstract: org.eclipse.collections.api.list.MutableList.without.

This method allows fixed size collections the ability to remove elements from their existing elements.

public MutableList<T>
withoutAll(Iterable<? extends T> elements)

Redeclares org.eclipse.collections.api.collection.FixedSizeCollection.withoutAll.

Redeclares as abstract: org.eclipse.collections.api.list.MutableList.withoutAll.

This method allows fixed size collections the ability to remove multiple elements from their existing elements.

Inherited from org.eclipse.collections.api.collection.FixedSizeCollection:
addaddAlladdAllIterableclearremoveremoveAllremoveAllIterableremoveIfremoveIfWithretainAllretainAllIterable
Inherited from org.eclipse.collections.api.list.MutableList:
asSynchronizedasUnmodifiableclonecollectcollectBooleancollectBytecollectCharcollectDoublecollectFloatcollectIfcollectIntcollectLongcollectShortcollectWithcollectWithIndexdistinctdistinctdistinctBydropdropWhileflatCollectflatCollectWithgetFirstgetLastgroupBygroupByEachindexOfnewEmptypartitionpartitionWhilepartitionWithrejectrejectWithrejectWithIndexreverseThisselectselectInstancesOfselectWithselectWithIndexshuffleThisshuffleThissortThisBysortThisByBooleansortThisByBytesortThisByCharsortThisByDoublesortThisByFloatsortThisByIntsortThisByLongsortThisByShortsubListtaketakeWhiletoArraytoArraytoImmutabletoImmutableListzipzipWithIndex

Method Detail

sortThisback to summary
public default FixedSizeList<T> sortThis(Comparator<? super T> comparator)

Overrides default org.eclipse.collections.api.list.MutableList.sortThis.

Doc from org.eclipse.collections.api.list.MutableList.sortThis.

Sorts the internal data structure of this list and returns the list itself as a convenience.

Annotations
@Override
sortThisback to summary
public default FixedSizeList<T> sortThis()

Overrides default org.eclipse.collections.api.list.MutableList.sortThis.

Doc from org.eclipse.collections.api.list.MutableList.sortThis.

Sorts the internal data structure of this list and returns the list itself as a convenience.

Annotations
@Override
tapback to summary
public FixedSizeList<T> tap(Procedure<? super T> procedure)

Redeclares org.eclipse.collections.api.collection.FixedSizeCollection.tap.

Redeclares as abstract: org.eclipse.collections.api.list.MutableList.tap.

Doc from org.eclipse.collections.api.RichIterable.tap.

Executes the Procedure for each element in the iterable and returns this.

Example using a Java 8 lambda expression:

RichIterable<Person> tapped =
    people.tap(person -> LOGGER.info(person.getName()));
Annotations
@Override
toReversedback to summary
public FixedSizeList<T> toReversed()

Redeclares as abstract: org.eclipse.collections.api.list.MutableList.toReversed.

Doc from org.eclipse.collections.api.list.MutableList.toReversed.

Returns a new MutableList in reverse order.

Annotations
@Override
withback to summary
public MutableList<T> with(T element)

Redeclares org.eclipse.collections.api.collection.FixedSizeCollection.with.

Redeclares as abstract: org.eclipse.collections.api.list.MutableList.with.

Doc from org.eclipse.collections.api.collection.FixedSizeCollection.with.

This method allows fixed size collections the ability to add elements to their existing elements. A new instance of MutableCollection is returned containing the elements of the original collection with the new element added. Implementations will return a new FixedSizeCollection where possible. In order to use this method properly with mutable and fixed size collections the following approach must be taken:

MutableCollection<String> list;
list = list.with("1");
list = list.with("2");
return list;
Annotations
@Override
withAllback to summary
public MutableList<T> withAll(Iterable<? extends T> elements)

Redeclares org.eclipse.collections.api.collection.FixedSizeCollection.withAll.

Redeclares as abstract: org.eclipse.collections.api.list.MutableList.withAll.

Doc from org.eclipse.collections.api.collection.FixedSizeCollection.withAll.

This method allows fixed size collections the ability to add multiple elements to their existing elements. A new instance of MutableCollection is returned containing the elements of the original collection with all the new elements addAll(Collection) added. Implementations will return a new FixedSizeCollection where possible. In order to use this method properly with mutable and fixed size collections the following approach must be taken:

MutableCollection<String> list;
list = list.withAll(FastList.newListWith("1", "2"));
return list;
Annotations
@Override
withoutback to summary
public MutableList<T> without(T element)

Redeclares org.eclipse.collections.api.collection.FixedSizeCollection.without.

Redeclares as abstract: org.eclipse.collections.api.list.MutableList.without.

Doc from org.eclipse.collections.api.collection.FixedSizeCollection.without.

This method allows fixed size collections the ability to remove elements from their existing elements. A new instance of MutableCollection is returned containing the elements of the original collection with the element removed. Implementations will return a new FixedSizeCollection where possible. In order to use this method properly with mutable and fixed size collections the following approach must be taken:

MutableCollection<String> list;
list = list.without("1");
list = list.without("2");
return list;
Annotations
@Override
withoutAllback to summary
public MutableList<T> withoutAll(Iterable<? extends T> elements)

Redeclares org.eclipse.collections.api.collection.FixedSizeCollection.withoutAll.

Redeclares as abstract: org.eclipse.collections.api.list.MutableList.withoutAll.

Doc from org.eclipse.collections.api.collection.FixedSizeCollection.withoutAll.

This method allows fixed size collections the ability to remove multiple elements from their existing elements. A new instance of MutableCollection is returned containing the elements of the original collection with the given elements removed. Implementations will return a new FixedSizeCollection where possible. In order to use this method properly with mutable and fixed size collections the following approach must be taken:

MutableCollection<String> list;
list = list.withoutAll(FastList.newListWith("1", "2"));
return list;
Annotations
@Override