Top Description Fields Constructors Methods
org.eclipse.collections.impl.list.immutable

pack-priv final Class ImmutableEmptyList<T>

extends AbstractImmutableList<T>
implements Serializable, RandomAccess
Class Inheritance
All Implemented Interfaces
java.util.RandomAccess, java.io.Serializable
Imports
java.io.IOException, .Serializable, java.util.Collection, .Comparator, .List, .NoSuchElementException, .Optional, .RandomAccess, org.eclipse.collections.api.bag.ImmutableBag, .MutableBagIterable, org.eclipse.collections.api.block.function.Function, .Function0, .Function2, org.eclipse.collections.api.block.function.primitive.DoubleObjectToDoubleFunction, .IntObjectToIntFunction, .LongObjectToLongFunction, org.eclipse.collections.api.block.predicate.Predicate, .Predicate2, org.eclipse.collections.api.block.procedure.Procedure, .Procedure2, org.eclipse.collections.api.block.procedure.primitive.ObjectIntProcedure, org.eclipse.collections.api.factory.Bags, .Lists, .Stacks, org.eclipse.collections.api.list.ImmutableList, org.eclipse.collections.api.partition.list.PartitionImmutableList, org.eclipse.collections.api.stack.MutableStack, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.partition.list.PartitionFastList

This is a zero element ImmutableList which is created by calling the Lists.immutable.empty() method.

Field Summary

Modifier and TypeField and Description
private static final PartitionImmutableList<?>
pack-priv static final ImmutableList<?>
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
allSatisfy(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.AbstractRichIterable.allSatisfy.

Implements org.eclipse.collections.api.RichIterable.allSatisfy.

Returns true if the predicate evaluates to true for every element of the iterable or if the iterable is empty.

public <P> boolean
allSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.AbstractRichIterable.allSatisfyWith.

Implements org.eclipse.collections.api.RichIterable.allSatisfyWith.

Returns true if the predicate evaluates to true for every element of the collection, or returns false.

public boolean
anySatisfy(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.AbstractRichIterable.anySatisfy.

Implements org.eclipse.collections.api.RichIterable.anySatisfy.

Returns true if the predicate evaluates to true for any element of the iterable.

public <P> boolean
anySatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.AbstractRichIterable.anySatisfyWith.

Implements org.eclipse.collections.api.RichIterable.anySatisfyWith.

Returns true if the predicate evaluates to true for any element of the collection, or return false.

public void
appendString(Appendable appendable)

Overrides default org.eclipse.collections.api.RichIterable.appendString.

Prints a string representation of this collection onto the given Appendable.

public void
appendString(Appendable appendable, String separator)

Overrides org.eclipse.collections.impl.AbstractRichIterable.appendString.

Overrides default org.eclipse.collections.api.RichIterable.appendString.

Prints a string representation of this collection onto the given Appendable.

public void
appendString(Appendable appendable, String start, String separator, String end)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.appendString.

Implements org.eclipse.collections.api.RichIterable.appendString.

Prints a string representation of this collection onto the given Appendable.

public <V> ImmutableList<V>
collect(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.collect.

Implements org.eclipse.collections.api.list.ImmutableList.collect, org.eclipse.collections.api.collection.ImmutableCollection.collect, org.eclipse.collections.api.RichIterable.collect.

Returns a new collection with the results of applying the specified function on each element of the source collection.

public <V, R extends Collection<V>> R
collect(Function<? super T, ? extends V> function, R target)

Overrides org.eclipse.collections.impl.AbstractRichIterable.collect.

Implements org.eclipse.collections.api.RichIterable.collect.

Same as collect(Function), except that the results are gathered into the specified target collection.

public <V> ImmutableList<V>
collectIf(Predicate<? super T> predicate, Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.collectIf.

Implements org.eclipse.collections.api.list.ImmutableList.collectIf, org.eclipse.collections.api.collection.ImmutableCollection.collectIf, org.eclipse.collections.api.RichIterable.collectIf.

Returns a new collection with the results of applying the specified function on each element of the source collection, but only for those elements which return true upon evaluation of the predicate.

public <V, R extends Collection<V>> R
collectIf(Predicate<? super T> predicate, Function<? super T, ? extends V> function, R target)

Overrides org.eclipse.collections.impl.AbstractRichIterable.collectIf.

Implements org.eclipse.collections.api.RichIterable.collectIf.

Same as the collectIf method with two parameters but uses the specified target collection for the results.

public <P, V, R extends Collection<V>> R
collectWith(Function2<? super T, ? super P, ? extends V> function, P parameter, R target)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.collectWith.

Implements org.eclipse.collections.api.RichIterable.collectWith.

Same as collectWith but with a targetCollection parameter to gather the results.

public boolean
public int
count(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.count.

Implements org.eclipse.collections.api.RichIterable.count.

Return the total number of elements that answer true to the specified predicate.

public <V> ImmutableBag<V>
countBy(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.collection.immutable.AbstractImmutableCollection.countBy.

Overrides default org.eclipse.collections.api.collection.ImmutableCollection.countBy, org.eclipse.collections.api.RichIterable.countBy.

This method will count the number of occurrences of each value calculated by applying the function to each element of the collection.

public <V, R extends MutableBagIterable<V>> R
countBy(Function<? super T, ? extends V> function, R target)

Overrides default org.eclipse.collections.api.RichIterable.countBy.

This method will count the number of occurrences of each value calculated by applying the function to each element of the collection.

public <V> ImmutableBag<V>
countByEach(Function<? super T, ? extends Iterable<V>> function)

Overrides org.eclipse.collections.impl.collection.immutable.AbstractImmutableCollection.countByEach.

Overrides default org.eclipse.collections.api.collection.ImmutableCollection.countByEach, org.eclipse.collections.api.RichIterable.countByEach.

This method will count the number of occurrences of each value calculated by applying the function to each element of the collection.

public <V, R extends MutableBagIterable<V>> R
countByEach(Function<? super T, ? extends Iterable<V>> function, R target)

Overrides default org.eclipse.collections.api.RichIterable.countByEach.

This method will count the number of occurrences of each value calculated by applying the function to each element of the collection.

public <V, P> ImmutableBag<V>
countByWith(Function2<? super T, ? super P, ? extends V> function, P parameter)

Overrides org.eclipse.collections.impl.collection.immutable.AbstractImmutableCollection.countByWith.

Overrides default org.eclipse.collections.api.collection.ImmutableCollection.countByWith, org.eclipse.collections.api.RichIterable.countByWith.

This method will count the number of occurrences of each value calculated by applying the function to each element of the collection with the specified parameter as the second argument.

public <V, P, R extends MutableBagIterable<V>> R
countByWith(Function2<? super T, ? super P, ? extends V> function, P parameter, R target)

Overrides default org.eclipse.collections.api.RichIterable.countByWith.

This method will count the number of occurrences of each value calculated by applying the function to each element of the collection with the specified parameter as the second argument.

public <P> int
countWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.AbstractRichIterable.countWith.

Implements org.eclipse.collections.api.RichIterable.countWith.

Returns the total number of elements that evaluate to true for the specified predicate.

public T
detect(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.AbstractRichIterable.detect.

Implements org.eclipse.collections.api.RichIterable.detect.

Returns the first element of the iterable for which the predicate evaluates to true or null in the case where no element returns true.

public T
detectIfNone(Predicate<? super T> predicate, Function0<? extends T> function)

Overrides default org.eclipse.collections.api.RichIterable.detectIfNone.

Returns the first element of the iterable for which the predicate evaluates to true.

public Optional<T>
detectOptional(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.AbstractRichIterable.detectOptional.

Implements org.eclipse.collections.api.RichIterable.detectOptional.

Returns the first element of the iterable for which the predicate evaluates to true as an Optional.

public ImmutableList<T>
drop(int count)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.drop.

Implements org.eclipse.collections.api.list.ImmutableList.drop.

Returns an iterable after skipping the first count elements or an empty iterable if the count is greater than the length of the iterable.

public ImmutableList<T>
dropWhile(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.dropWhile.

Implements org.eclipse.collections.api.list.ImmutableList.dropWhile.

Returns the final elements that do not satisfy the Predicate.

public void
each(Procedure<? super T> procedure)

Implements org.eclipse.collections.api.RichIterable.each.

The procedure is executed for each element in the iterable.

public boolean
public <V> ImmutableList<V>
public <V, R extends Collection<V>> R
flatCollect(Function<? super T, ? extends Iterable<V>> function, R targetCollection)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.flatCollect.

Implements org.eclipse.collections.api.RichIterable.flatCollect.

Same as flatCollect, only the results are collected into the target collection.

public <P> void
forEachWith(Procedure2<? super T, ? super P> procedure, P parameter)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.forEachWith.

Implements org.eclipse.collections.api.InternalIterable.forEachWith.

The procedure2 is evaluated for each element in the iterable with the specified parameter provided as the second argument.

public void
forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.forEachWithIndex.

Implements org.eclipse.collections.api.InternalIterable.forEachWithIndex, org.eclipse.collections.api.ordered.OrderedIterable.forEachWithIndex.

Iterates over the iterable passing each element and the current relative int index to the specified instance of ObjectIntProcedure.

public T
get(int index)

Implements org.eclipse.collections.api.list.ListIterable.get, java.util.List.get.

Returns the element at the specified position in this list.

public T
public T
public T
getOnly()

Overrides default org.eclipse.collections.api.RichIterable.getOnly.

Returns the element if the iterable has exactly one element.

public int
public <IV> IV
injectInto(IV injectedValue, Function2<? super IV, ? super T, ? extends IV> function)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.injectInto.

Implements org.eclipse.collections.api.RichIterable.injectInto.

Returns the final result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.

public int
injectInto(int injectedValue, IntObjectToIntFunction<? super T> intObjectToIntFunction)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.injectInto.

Implements org.eclipse.collections.api.RichIterable.injectInto.

Returns the final int result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.

public long
injectInto(long injectedValue, LongObjectToLongFunction<? super T> longObjectToLongFunction)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.injectInto.

Implements org.eclipse.collections.api.RichIterable.injectInto.

Returns the final long result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.

public double
injectInto(double injectedValue, DoubleObjectToDoubleFunction<? super T> doubleObjectToDoubleFunction)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.injectInto.

Implements org.eclipse.collections.api.RichIterable.injectInto.

Returns the final double result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.

public boolean
public String
makeString()

Overrides default org.eclipse.collections.api.RichIterable.makeString.

Returns a string representation of this collection by delegating to makeString(String) and defaulting the separator parameter to the characters ", " (comma and space).

public String
makeString(String separator)

Overrides default org.eclipse.collections.api.RichIterable.makeString.

Returns a string representation of this collection by delegating to makeString(String, String, String) and defaulting the start and end parameters to "" (the empty String).

public String
makeString(String start, String separator, String end)

Overrides default org.eclipse.collections.api.RichIterable.makeString.

Returns a string representation of this collection with the elements separated by the specified separator and enclosed between the start and end strings.

public T
max(Comparator<? super T> comparator)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.max.

Implements org.eclipse.collections.api.RichIterable.max.

Returns the maximum element out of this container based on the comparator.

public T
public <V extends Comparable<? super V>> T
maxBy(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.maxBy.

Implements org.eclipse.collections.api.RichIterable.maxBy.

Returns the maximum elements out of this container based on the natural order of the attribute returned by Function.

public T
min(Comparator<? super T> comparator)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.min.

Implements org.eclipse.collections.api.RichIterable.min.

Returns the minimum element out of this container based on the comparator.

public T
public <V extends Comparable<? super V>> T
minBy(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.minBy.

Implements org.eclipse.collections.api.RichIterable.minBy.

Returns the minimum elements out of this container based on the natural order of the attribute returned by Function.

public ImmutableList<T>
newWith(T newItem)

Implements org.eclipse.collections.api.list.ImmutableList.newWith, org.eclipse.collections.api.collection.ImmutableCollection.newWith.

This method is similar to the with method in MutableCollection with the difference that a new copy of this collection with the element appended will be returned.

public ImmutableList<T>
newWithout(T element)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.newWithout.

Implements org.eclipse.collections.api.list.ImmutableList.newWithout, org.eclipse.collections.api.collection.ImmutableCollection.newWithout.

This method is similar to the without method in MutableCollection with the difference that a new copy of this collection with the element removed will be returned.

public ImmutableList<T>
newWithoutAll(Iterable<? extends T> elements)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.newWithoutAll.

Implements org.eclipse.collections.api.list.ImmutableList.newWithoutAll, org.eclipse.collections.api.collection.ImmutableCollection.newWithoutAll.

This method is similar to the withoutAll method in MutableCollection with the difference that a new copy of this collection with the elements removed will be returned.

public boolean
noneSatisfy(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.AbstractRichIterable.noneSatisfy.

Implements org.eclipse.collections.api.RichIterable.noneSatisfy.

Returns true if the predicate evaluates to false for every element of the iterable or if the iterable is empty.

public <P> boolean
noneSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.AbstractRichIterable.noneSatisfyWith.

Implements org.eclipse.collections.api.RichIterable.noneSatisfyWith.

Returns true if the predicate evaluates to false for every element of the collection, or return false.

public boolean
notEmpty()

Overrides default org.eclipse.collections.api.RichIterable.notEmpty.

The English equivalent of !this.isEmpty()

public PartitionImmutableList<T>
public PartitionImmutableList<T>
partitionWhile(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.partitionWhile.

Implements org.eclipse.collections.api.list.ImmutableList.partitionWhile.

Returns a Partition of the initial elements that satisfy the Predicate and the remaining elements.

private Object
public ImmutableList<T>
public <R extends Collection<T>> R
reject(Predicate<? super T> predicate, R target)

Overrides org.eclipse.collections.impl.AbstractRichIterable.reject.

Implements org.eclipse.collections.api.RichIterable.reject.

Same as the reject method with one parameter but uses the specified target collection for the results.

public <P, R extends Collection<T>> R
rejectWith(Predicate2<? super T, ? super P> predicate, P parameter, R target)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.rejectWith.

Implements org.eclipse.collections.api.RichIterable.rejectWith.

Similar to reject(Predicate, Collection), except with an evaluation parameter for the second generic argument in Predicate2.

public void
reverseForEach(Procedure<? super T> procedure)

Overrides default org.eclipse.collections.api.ordered.ReversibleIterable.reverseForEach.

Evaluates the procedure for each element of the list iterating in reverse order.

public void
reverseForEachWithIndex(ObjectIntProcedure<? super T> procedure)

Overrides default org.eclipse.collections.api.ordered.ReversibleIterable.reverseForEachWithIndex.

Evaluates the procedure for each element and it's index in reverse order.

public ImmutableList<T>
public <R extends Collection<T>> R
select(Predicate<? super T> predicate, R target)

Overrides org.eclipse.collections.impl.AbstractRichIterable.select.

Implements org.eclipse.collections.api.RichIterable.select.

Same as the select method with one parameter but uses the specified target collection for the results.

public <P, R extends Collection<T>> R
selectWith(Predicate2<? super T, ? super P> predicate, P parameter, R target)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.selectWith.

Implements org.eclipse.collections.api.RichIterable.selectWith.

Similar to select(Predicate, Collection), except with an evaluation parameter for the second generic argument in Predicate2.

public int
size()

Implements org.eclipse.collections.api.RichIterable.size, java.util.List.size, java.util.Collection.size.

Returns the number of elements in this list.

public ImmutableList<T>
take(int count)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.take.

Implements org.eclipse.collections.api.list.ImmutableList.take.

Returns the first count elements of the iterable or all the elements in the iterable if count is greater than the length of the iterable.

public ImmutableList<T>
takeWhile(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.takeWhile.

Implements org.eclipse.collections.api.list.ImmutableList.takeWhile.

Returns the initial elements that satisfy the Predicate.

public ImmutableList<T>
public MutableStack<T>
toStack()

Overrides default org.eclipse.collections.api.ordered.OrderedIterable.toStack.

Converts the OrderedIterable to a mutable MutableStack implementation.

public String
toString()

Overrides org.eclipse.collections.impl.AbstractRichIterable.toString.

Implements org.eclipse.collections.api.RichIterable.toString.

Returns a string with the elements of this iterable separated by commas with spaces and enclosed in square brackets.

public <S> ImmutableList<Pair<T, S>>
zip(Iterable<S> that)

Overrides org.eclipse.collections.impl.list.immutable.AbstractImmutableList.zip.

Implements org.eclipse.collections.api.list.ImmutableList.zip, org.eclipse.collections.api.collection.ImmutableCollection.zip, org.eclipse.collections.api.RichIterable.zip.

Returns a RichIterable formed from this RichIterable and another RichIterable by combining corresponding elements in pairs.

public <S, R extends Collection<Pair<T, S>>> R
public ImmutableList<Pair<T, Integer>>
public <R extends Collection<Pair<T, Integer>>> R
Inherited from org.eclipse.collections.impl.list.immutable.AbstractImmutableList:
addaddAllasParallelasReversedcastToListchunkcollectBooleancollectBytecollectCharcollectDoublecollectFloatcollectIntcollectLongcollectShortcollectWithcorrespondsdetectIndexdetectLastIndexdistinctdistinctdistinctByforEachforEachWithIndexgroupBygroupBygroupByEachgroupByEachindexOfinjectIntoiteratorlastIndexOflistIteratorlistIteratornewMutablenewWithAllpartitionWithregularListEqualsrejectWithremovereplaceAllselectInstancesOfselectWithsetsortsubListsumOfDoublesumOfFloatsumOfIntsumOfLongtoImmutabletoReversed