Top Description Inners Fields Constructors Methods
org.eclipse.collections.impl.list.primitive

public final Class LongInterval

extends Object
implements ImmutableLongList, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.eclipse.collections.api.list.primitive.ImmutableLongList, org.eclipse.collections.api.list.primitive.LongList, org.eclipse.collections.api.ordered.primitive.ReversibleLongIterable, org.eclipse.collections.api.ordered.primitive.OrderedLongIterable, org.eclipse.collections.api.LongIterable, org.eclipse.collections.api.PrimitiveIterable, org.eclipse.collections.api.collection.primitive.ImmutableLongCollection
Imports
java.io.IOException, .Serializable, java.util.Arrays, .Comparator, .Iterator, .NoSuchElementException, .Spliterator, java.util.function.LongConsumer, org.eclipse.collections.api.LazyLongIterable, .LongIterable, .RichIterable, org.eclipse.collections.api.bag.primitive.MutableLongBag, org.eclipse.collections.api.block.function.primitive.LongToObjectFunction, .ObjectLongIntToObjectFunction, .ObjectLongToObjectFunction, org.eclipse.collections.api.block.predicate.primitive.LongPredicate, org.eclipse.collections.api.block.procedure.primitive.LongIntProcedure, .LongLongProcedure, .LongProcedure, org.eclipse.collections.api.factory.Lists, org.eclipse.collections.api.factory.primitive.LongBags, .LongLists, .LongSets, org.eclipse.collections.api.iterator.LongIterator, org.eclipse.collections.api.list.ImmutableList, .MutableList, org.eclipse.collections.api.list.primitive.ImmutableLongList, .LongList, .MutableLongList, org.eclipse.collections.api.set.primitive.MutableLongSet, org.eclipse.collections.api.stack.primitive.MutableLongStack, org.eclipse.collections.api.tuple.primitive.LongLongPair, .LongObjectPair, org.eclipse.collections.impl.factory.primitive.LongStacks, org.eclipse.collections.impl.lazy.primitive.CollectLongToObjectIterable, .LazyLongIterableAdapter, .ReverseLongIterable, .SelectLongIterable, org.eclipse.collections.impl.list.IntervalUtils, org.eclipse.collections.impl.tuple.primitive.PrimitiveTuples, org.eclipse.collections.impl.utility.Iterate

An LongInterval is a range of longs that may be iterated over using a step value. Note that the size of the interval (the number of elements in the list it represents) is limited by the maximum value of the integer index.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private static class

Field Summary

Modifier and TypeField and Description
private final long
private static final long
private final int
private final long
private final long

Constructor Summary

AccessConstructor and Description
private
LongInterval(long from, long to, long step)

Method Summary

Modifier and TypeMethod and Description
public boolean
allSatisfy(LongPredicate predicate)

Implements org.eclipse.collections.api.LongIterable.allSatisfy.

Returns true if all of the elements in the LongIterable return true for the specified predicate, otherwise returns false.

public boolean
anySatisfy(LongPredicate predicate)

Implements org.eclipse.collections.api.LongIterable.anySatisfy.

Returns true if any of the elements in the LongIterable return true for the specified predicate, otherwise returns false.

public void
appendString(Appendable appendable)

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

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

public void
appendString(Appendable appendable, String separator)

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

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

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

Implements org.eclipse.collections.api.PrimitiveIterable.appendString.

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

public LazyLongIterable
asLazy()

Implements org.eclipse.collections.api.LongIterable.asLazy.

Returns a LazyLongIterable adapter wrapping the source LongIterable.

public LazyLongIterable
public double
public int
public LongInterval
by(long newStep)

This instance by method allows LongInterval to act as a fluent builder for itself.

private static long
calculateAdjustedStep(long from, long to, long stepBy)

private void
checkBounds(String name, int index)

public RichIterable<LongIterable>
chunk(int size)

Overrides default org.eclipse.collections.api.LongIterable.chunk.

Partitions elements in fixed size chunks.

public <V> ImmutableList<V>
collect(LongToObjectFunction<? extends V> function)

Implements org.eclipse.collections.api.list.primitive.ImmutableLongList.collect.

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

public boolean
contains(long value)

Implements org.eclipse.collections.api.LongIterable.contains.

Returns true if the LongInterval contains the specified long value.

public boolean
containsAll(long... values)

Overrides default org.eclipse.collections.api.LongIterable.containsAll.

Returns true if the LongInterval contains all the specified long values.

public boolean
containsAll(LongIterable source)

Overrides default org.eclipse.collections.api.LongIterable.containsAll.

Returns true if all of the values specified in the source LongIterable are contained in the LongIterable, and false if they are not.

public boolean
containsNone(int... values)

Returns true if the LongInterval contains none of the specified long values.

public int
count(LongPredicate predicate)

Implements org.eclipse.collections.api.LongIterable.count.

Returns a count of the number of elements in the LongIterable that return true for the specified predicate.

public long
public ImmutableLongList
public long
public void
each(LongProcedure procedure)

Implements org.eclipse.collections.api.LongIterable.each.

A synonym for forEach.

public boolean
public static LongInterval
evensFromTo(long from, long to)

Returns an LongInterval representing the even values from the value from to the value to.

public void
public void
forEachWithLongIndex(LongLongProcedure procedure)
Deprecated for removal.

public static LongInterval
from(long newFrom)

This static from method allows LongInterval to act as a fluent builder for itself.

public static LongInterval
fromTo(long from, long to)

Returns an LongInterval starting from the value from to the specified value to with a step value of 1.

public static LongInterval
fromToBy(long from, long to, long stepBy)

Returns an LongInterval for the range of integers inclusively between from and to with the specified stepBy value.

public long
public long
public long
private boolean
public int
public int
public <T> T
injectInto(T injectedValue, ObjectLongToObjectFunction<? super T, ? extends T> function)

Implements org.eclipse.collections.api.LongIterable.injectInto.

public <T> T
public boolean
isEmpty()

Overrides default org.eclipse.collections.api.PrimitiveIterable.isEmpty.

Returns true if this iterable has zero items.

public int
public LongIterator
longIterator()

Implements org.eclipse.collections.api.LongIterable.longIterator.

Returns a primitive iterator that can be used to iterate over the LongIterable in an imperative style.

public String
makeString()

Overrides default org.eclipse.collections.api.PrimitiveIterable.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.PrimitiveIterable.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.PrimitiveIterable.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 long
public long
public double
public long
public long
public ImmutableLongList
public ImmutableLongList
public ImmutableLongList
public ImmutableLongList
public boolean
notEmpty()

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

The English equivalent of !this.isEmpty()

public static LongInterval
oddsFromTo(long from, long to)

Returns an LongInterval representing the odd values from the value from to the value to.

public static LongInterval
oneTo(long count)

Returns an LongInterval starting from 1 to the specified count value with a step value of 1.

public static LongInterval
oneToBy(long count, long step)

Returns an LongInterval starting from 1 to the specified count value with a step value of step.

public ImmutableLongList
reject(LongPredicate predicate)

Implements org.eclipse.collections.api.list.primitive.ImmutableLongList.reject.

Returns a new LongIterable with all of the elements in the LongIterable that return false for the specified predicate.

public ImmutableLongList
select(LongPredicate predicate)

Implements org.eclipse.collections.api.list.primitive.ImmutableLongList.select.

Returns a new LongIterable with all of the elements in the LongIterable that return true for the specified predicate.

public int
size()

Implements org.eclipse.collections.api.PrimitiveIterable.size.

Returns the size of the interval.

public Spliterator.OfLong
public ImmutableLongList
public long
public LongInterval
to(long newTo)

This instance to method allows LongInterval to act as a fluent builder for itself.

public long[]
toArray()

Implements org.eclipse.collections.api.LongIterable.toArray.

Converts the LongIterable to a primitive long array.

public long[]
toArray(long[] result)

Overrides default org.eclipse.collections.api.LongIterable.toArray.

Converts the LongIterable to a primitive long array.

public MutableLongBag
toBag()

Implements org.eclipse.collections.api.LongIterable.toBag.

Converts the LongIterable to a new MutableLongBag.

public ImmutableLongList
toImmutable()

Implements org.eclipse.collections.api.list.primitive.LongList.toImmutable.

Returns an immutable copy of this list.

public MutableLongList
toList()

Implements org.eclipse.collections.api.LongIterable.toList.

Converts the LongIterable to a new MutableLongList.

public LongInterval
toReversed()

Implements org.eclipse.collections.api.list.primitive.ImmutableLongList.toReversed.

Returns a new LongInterval with the from and to values reversed and the step value negated.

public MutableLongSet
toSet()

Implements org.eclipse.collections.api.LongIterable.toSet.

Converts the LongIterable to a new MutableLongSet.

public long[]
public MutableLongList
public MutableLongStack
toStack()

Overrides default org.eclipse.collections.api.ordered.primitive.OrderedLongIterable.toStack.

Converts the collection to a LongStack.

public String
toString()

Overrides java.lang.Object.toString.

Implements org.eclipse.collections.api.PrimitiveIterable.toString.

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

public static LongInterval
zero()

Returns an LongInterval starting at zero.

public static LongInterval
zeroTo(long count)

Returns an LongInterval starting from 0 to the specified count value with a step value of 1.

public static LongInterval
zeroToBy(long count, long step)

Returns an LongInterval starting from 0 to the specified count value with a step value of step.

public <T> ImmutableList<LongObjectPair<T>>
zip(Iterable<T> iterable)

Overrides default org.eclipse.collections.api.list.primitive.ImmutableLongList.zip.

Returns an ImmutableList formed from this ImmutableLongList and a ListIterable by combining corresponding elements in pairs.

public ImmutableList<LongLongPair>
zipLong(LongIterable iterable)

Overrides default org.eclipse.collections.api.list.primitive.ImmutableLongList.zipLong.

Returns an ImmutableList formed from this ImmutableLongList and another LongList by combining corresponding elements in pairs.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait