public final class LongInterval extends Object implements ImmutableLongList, Serializable
| Modifier and Type | Method and Description |
|---|---|
boolean |
allSatisfy(LongPredicate predicate) |
boolean |
anySatisfy(LongPredicate predicate) |
void |
appendString(Appendable appendable) |
void |
appendString(Appendable appendable,
String separator) |
void |
appendString(Appendable appendable,
String start,
String separator,
String end) |
LazyLongIterable |
asLazy() |
LazyLongIterable |
asReversed() |
double |
average() |
int |
binarySearch(long value) |
LongInterval |
by(long newStep)
This instance
by method allows LongInterval to act as a fluent builder for itself. |
RichIterable<LongIterable> |
chunk(int size) |
<V> ImmutableList<V> |
collect(LongToObjectFunction<? extends V> function) |
boolean |
contains(long value)
Returns true if the LongInterval contains the specified long value.
|
boolean |
containsAll(long... values)
Returns true if the LongInterval contains all the specified long values.
|
boolean |
containsAll(LongIterable source) |
boolean |
containsNone(int... values)
Returns true if the LongInterval contains none of the specified long values.
|
int |
count(LongPredicate predicate) |
long |
detectIfNone(LongPredicate predicate,
long ifNone) |
ImmutableLongList |
distinct() |
long |
dotProduct(LongList list) |
void |
each(LongProcedure procedure) |
boolean |
equals(Object otherList) |
static LongInterval |
evensFromTo(long from,
long to)
Returns an LongInterval representing the even values from the value from to the value to.
|
void |
forEachWithIndex(LongIntProcedure procedure) |
void |
forEachWithLongIndex(LongLongProcedure procedure) |
static LongInterval |
from(long newFrom)
This static
from method allows LongInterval to act as a fluent builder for itself. |
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.
|
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.
|
long |
get(int index) |
long |
getFirst() |
long |
getLast() |
int |
hashCode() |
int |
indexOf(long value) |
<T> T |
injectInto(T injectedValue,
ObjectLongToObjectFunction<? super T,? extends T> function) |
<T> T |
injectIntoWithIndex(T injectedValue,
ObjectLongIntToObjectFunction<? super T,? extends T> function) |
boolean |
isEmpty() |
int |
lastIndexOf(long value) |
LongIterator |
longIterator() |
String |
makeString() |
String |
makeString(String separator) |
String |
makeString(String start,
String separator,
String end) |
long |
max() |
long |
maxIfEmpty(long defaultValue) |
double |
median() |
long |
min() |
long |
minIfEmpty(long defaultValue) |
ImmutableLongList |
newWith(long element) |
ImmutableLongList |
newWithAll(LongIterable elements) |
ImmutableLongList |
newWithout(long element) |
ImmutableLongList |
newWithoutAll(LongIterable elements) |
boolean |
notEmpty() |
static LongInterval |
oddsFromTo(long from,
long to)
Returns an LongInterval representing the odd values from the value from to the value to.
|
static LongInterval |
oneTo(long count)
Returns an LongInterval starting from 1 to the specified count value with a step value of 1.
|
static LongInterval |
oneToBy(long count,
long step)
Returns an LongInterval starting from 1 to the specified count value with a step value of step.
|
ImmutableLongList |
reject(LongPredicate predicate) |
ImmutableLongList |
select(LongPredicate predicate) |
int |
size()
Returns the size of the interval.
|
Spliterator.OfLong |
spliterator() |
ImmutableLongList |
subList(int fromIndex,
int toIndex) |
long |
sum() |
LongInterval |
to(long newTo)
This instance
to method allows LongInterval to act as a fluent builder for itself. |
long[] |
toArray() |
long[] |
toArray(long[] result) |
MutableLongBag |
toBag() |
ImmutableLongList |
toImmutable() |
MutableLongList |
toList() |
LongInterval |
toReversed()
Returns a new LongInterval with the from and to values reversed and the step value negated.
|
MutableLongSet |
toSet() |
long[] |
toSortedArray() |
MutableLongList |
toSortedList() |
String |
toString() |
static LongInterval |
zero()
Returns an LongInterval starting at zero.
|
static LongInterval |
zeroTo(long count)
Returns an LongInterval starting from 0 to the specified count value with a step value of 1.
|
static LongInterval |
zeroToBy(long count,
long step)
Returns an LongInterval starting from 0 to the specified count value with a step value of step.
|
<T> ImmutableList<LongObjectPair<T>> |
zip(Iterable<T> iterable) |
ImmutableList<LongLongPair> |
zipLong(LongIterable iterable) |
collectWithIndex, rejectWithIndex, selectWithIndex, tapforEachInBoth, primitiveParallelStream, primitiveStreamcollectWithIndex, rejectWithIndex, selectWithIndexaverageIfEmpty, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAny, containsAny, containsNone, containsNone, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, medianIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, summaryStatistics, toSortedList, toSortedListBy, toSortedListBypublic static LongInterval from(long newFrom)
from method allows LongInterval to act as a fluent builder for itself.
It works in conjunction with the instance methods to(long) and by(long).
Usage Example:
LongInterval interval1 = LongInterval.from(1).to(5); // results in: 1, 2, 3, 4, 5. LongInterval interval2 = LongInterval.from(1).to(10).by(2); // results in: 1, 3, 5, 7, 9.
public LongInterval to(long newTo)
to method allows LongInterval to act as a fluent builder for itself.
It works in conjunction with the static method from(long) and instance method by(long).
Usage Example:
LongInterval interval1 = LongInterval.from(1).to(5); // results in: 1, 2, 3, 4, 5. LongInterval interval2 = LongInterval.from(1).to(10).by(2); // results in: 1, 3, 5, 7, 9.
public LongInterval by(long newStep)
by method allows LongInterval to act as a fluent builder for itself.
It works in conjunction with the static method from(long) and instance method to(long).
Usage Example:
LongInterval interval1 = LongInterval.from(1).to(5); // results in: 1, 2, 3, 4, 5. LongInterval interval2 = LongInterval.from(1).to(10).by(2); // results in: 1, 3, 5, 7, 9.
public static LongInterval zero()
Usage Example:
LongInterval interval1 = LongInterval.zero().to(5); // results in: 0, 1, 2, 3, 4, 5. LongInterval interval2 = LongInterval.zero().to(10).by(2); // results in: 0, 2, 4, 6, 8, 10.
public static LongInterval oneTo(long count)
public static LongInterval oneToBy(long count, long step)
public static LongInterval zeroTo(long count)
public static LongInterval zeroToBy(long count, long step)
public static LongInterval fromTo(long from, long to)
public static LongInterval evensFromTo(long from, long to)
public static LongInterval oddsFromTo(long from, long to)
public static LongInterval fromToBy(long from, long to, long stepBy)
public boolean containsAll(long... values)
containsAll in interface LongIterablepublic boolean containsAll(LongIterable source)
containsAll in interface LongIterablepublic boolean containsNone(int... values)
public boolean contains(long value)
contains in interface LongIterablepublic void forEachWithIndex(LongIntProcedure procedure)
forEachWithIndex in interface OrderedLongIterablepublic void forEachWithLongIndex(LongLongProcedure procedure)
public void each(LongProcedure procedure)
each in interface LongIterablepublic int count(LongPredicate predicate)
count in interface LongIterablepublic boolean anySatisfy(LongPredicate predicate)
anySatisfy in interface LongIterablepublic boolean allSatisfy(LongPredicate predicate)
allSatisfy in interface LongIterablepublic boolean equals(Object otherList)
public int hashCode()
public LongInterval toReversed()
toReversed in interface ImmutableLongListtoReversed in interface LongListtoReversed in interface ReversibleLongIterablepublic ImmutableLongList distinct()
distinct in interface ImmutableLongListdistinct in interface LongListdistinct in interface ReversibleLongIterablepublic ImmutableLongList subList(int fromIndex, int toIndex)
subList in interface ImmutableLongListsubList in interface LongListpublic int size()
size in interface PrimitiveIterablepublic long dotProduct(LongList list)
dotProduct in interface LongListpublic boolean isEmpty()
isEmpty in interface PrimitiveIterablepublic boolean notEmpty()
notEmpty in interface PrimitiveIterablepublic String makeString()
makeString in interface PrimitiveIterablepublic String makeString(String separator)
makeString in interface PrimitiveIterablepublic String makeString(String start, String separator, String end)
makeString in interface PrimitiveIterablepublic void appendString(Appendable appendable)
appendString in interface PrimitiveIterablepublic void appendString(Appendable appendable, String separator)
appendString in interface PrimitiveIterablepublic void appendString(Appendable appendable, String start, String separator, String end)
appendString in interface PrimitiveIterablepublic long[] toArray()
toArray in interface LongIterablepublic long[] toArray(long[] result)
toArray in interface LongIterablepublic <T> T injectInto(T injectedValue,
ObjectLongToObjectFunction<? super T,? extends T> function)
injectInto in interface LongIterablepublic <T> T injectIntoWithIndex(T injectedValue,
ObjectLongIntToObjectFunction<? super T,? extends T> function)
injectIntoWithIndex in interface OrderedLongIterableinjectIntoWithIndex in interface ReversibleLongIterablepublic RichIterable<LongIterable> chunk(int size)
chunk in interface LongIterablepublic String toString()
toString in interface PrimitiveIterabletoString in class Objectpublic LongIterator longIterator()
longIterator in interface LongIterablepublic long getFirst()
getFirst in interface OrderedLongIterablepublic long getLast()
getLast in interface ReversibleLongIterablepublic int indexOf(long value)
indexOf in interface OrderedLongIterablepublic int lastIndexOf(long value)
lastIndexOf in interface LongListpublic ImmutableLongList select(LongPredicate predicate)
select in interface ImmutableLongCollectionselect in interface ImmutableLongListselect in interface LongListselect in interface LongIterableselect in interface OrderedLongIterableselect in interface ReversibleLongIterablepublic ImmutableLongList reject(LongPredicate predicate)
reject in interface ImmutableLongCollectionreject in interface ImmutableLongListreject in interface LongListreject in interface LongIterablereject in interface OrderedLongIterablereject in interface ReversibleLongIterablepublic long detectIfNone(LongPredicate predicate, long ifNone)
detectIfNone in interface LongIterablepublic <V> ImmutableList<V> collect(LongToObjectFunction<? extends V> function)
collect in interface ImmutableLongCollectioncollect in interface ImmutableLongListcollect in interface LongListcollect in interface LongIterablecollect in interface OrderedLongIterablecollect in interface ReversibleLongIterablepublic LazyLongIterable asReversed()
asReversed in interface ReversibleLongIterablepublic long sum()
sum in interface LongIterablepublic long max()
max in interface LongIterablepublic long min()
min in interface LongIterablepublic long minIfEmpty(long defaultValue)
minIfEmpty in interface LongIterablepublic long maxIfEmpty(long defaultValue)
maxIfEmpty in interface LongIterablepublic double average()
average in interface LongIterablepublic double median()
median in interface LongIterablepublic int binarySearch(long value)
binarySearch in interface LongListpublic long[] toSortedArray()
toSortedArray in interface LongIterablepublic MutableLongList toList()
toList in interface LongIterablepublic MutableLongList toSortedList()
toSortedList in interface LongIterablepublic MutableLongSet toSet()
toSet in interface LongIterablepublic MutableLongBag toBag()
toBag in interface LongIterablepublic LazyLongIterable asLazy()
asLazy in interface LongIterablepublic ImmutableLongList toImmutable()
toImmutable in interface LongListpublic ImmutableLongList newWith(long element)
newWith in interface ImmutableLongCollectionnewWith in interface ImmutableLongListpublic ImmutableLongList newWithout(long element)
newWithout in interface ImmutableLongCollectionnewWithout in interface ImmutableLongListpublic ImmutableLongList newWithAll(LongIterable elements)
newWithAll in interface ImmutableLongCollectionnewWithAll in interface ImmutableLongListpublic ImmutableLongList newWithoutAll(LongIterable elements)
newWithoutAll in interface ImmutableLongCollectionnewWithoutAll in interface ImmutableLongListpublic ImmutableList<LongLongPair> zipLong(LongIterable iterable)
zipLong in interface ImmutableLongListzipLong in interface LongListpublic <T> ImmutableList<LongObjectPair<T>> zip(Iterable<T> iterable)
zip in interface ImmutableLongListzip in interface LongListpublic Spliterator.OfLong spliterator()
spliterator in interface LongListCopyright © 2004–2022. All rights reserved.