LazyLongIterable
, LongIterable
, PrimitiveIterable
public class LazyLongIterableAdapter extends AbstractLazyLongIterable
Constructor | Description |
---|---|
LazyLongIterableAdapter(LongIterable delegate) |
Modifier and Type | Method | Description |
---|---|---|
boolean |
allSatisfy(LongPredicate predicate) |
Returns true if all of the elements in the LongIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
anySatisfy(LongPredicate predicate) |
Returns true if any of the elements in the LongIterable return true for the
specified predicate, otherwise returns false.
|
void |
appendString(Appendable appendable) |
Prints a string representation of this collection onto the given
Appendable . |
void |
appendString(Appendable appendable,
String separator) |
Prints a string representation of this collection onto the given
Appendable . |
void |
appendString(Appendable appendable,
String start,
String separator,
String end) |
Prints a string representation of this collection onto the given
Appendable . |
double |
average() |
|
boolean |
contains(long value) |
Returns true if the value is contained in the LongIterable, and false if it is not.
|
boolean |
containsAll(long... source) |
Returns true if the all of the values specified in the source array are contained
in the LongIterable, and false if they are not.
|
boolean |
containsAll(LongIterable source) |
Returns true if the all of the values specified in the source LongIterable are contained
in the LongIterable, and false if they are not.
|
int |
count(LongPredicate predicate) |
Returns a count of the number of elements in the LongIterable that return true for the
specified predicate.
|
long |
detectIfNone(LongPredicate predicate,
long ifNone) |
|
void |
each(LongProcedure procedure) |
A synonym for forEach.
|
<T> T |
injectInto(T injectedValue,
ObjectLongToObjectFunction<? super T,? extends T> function) |
|
boolean |
isEmpty() |
Returns true if this iterable has zero items.
|
LongIterator |
longIterator() |
Returns a primitive iterator that can be used to iterate over the LongIterable in an
imperative style.
|
String |
makeString() |
Returns a string representation of this collection by delegating to
PrimitiveIterable.makeString(String) and defaulting
the separator parameter to the characters ", " (comma and space). |
String |
makeString(String separator) |
Returns a string representation of this collection by delegating to
PrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String). |
String |
makeString(String start,
String separator,
String end) |
Returns a string representation of this collection with the elements separated by the specified
separator and enclosed between the start and end strings.
|
long |
max() |
|
long |
maxIfEmpty(long defaultValue) |
|
double |
median() |
|
long |
min() |
|
long |
minIfEmpty(long defaultValue) |
|
boolean |
noneSatisfy(LongPredicate predicate) |
Returns true if none of the elements in the LongIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
notEmpty() |
The English equivalent of !this.isEmpty()
|
int |
size() |
Returns the number of items in this iterable.
|
long |
sum() |
|
long[] |
toArray() |
Converts the LongIterable to a primitive long array.
|
MutableLongBag |
toBag() |
Converts the LongIterable to a new MutableLongBag.
|
MutableLongList |
toList() |
Converts the LongIterable to a new MutableLongList.
|
MutableLongSet |
toSet() |
Converts the LongIterable to a new MutableLongSet.
|
long[] |
toSortedArray() |
|
MutableLongList |
toSortedList() |
|
String |
toString() |
Returns a string with the elements of this iterable separated by commas with spaces and
enclosed in square brackets.
|
asLazy, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, forEach, reject, select
collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, flatCollect, reject, select, summaryStatistics
public LazyLongIterableAdapter(LongIterable delegate)
public LongIterator longIterator()
LongIterable
public void each(LongProcedure procedure)
LongIterable
public int size()
PrimitiveIterable
size
in interface PrimitiveIterable
size
in class AbstractLazyLongIterable
public boolean isEmpty()
PrimitiveIterable
isEmpty
in interface PrimitiveIterable
isEmpty
in class AbstractLazyLongIterable
public boolean notEmpty()
PrimitiveIterable
notEmpty
in interface PrimitiveIterable
notEmpty
in class AbstractLazyLongIterable
public int count(LongPredicate predicate)
LongIterable
count
in interface LongIterable
count
in class AbstractLazyLongIterable
public boolean anySatisfy(LongPredicate predicate)
LongIterable
anySatisfy
in interface LongIterable
anySatisfy
in class AbstractLazyLongIterable
public boolean allSatisfy(LongPredicate predicate)
LongIterable
allSatisfy
in interface LongIterable
allSatisfy
in class AbstractLazyLongIterable
public boolean noneSatisfy(LongPredicate predicate)
LongIterable
noneSatisfy
in interface LongIterable
noneSatisfy
in class AbstractLazyLongIterable
public long detectIfNone(LongPredicate predicate, long ifNone)
detectIfNone
in interface LongIterable
detectIfNone
in class AbstractLazyLongIterable
public long sum()
sum
in interface LongIterable
sum
in class AbstractLazyLongIterable
public long max()
max
in interface LongIterable
max
in class AbstractLazyLongIterable
public long min()
min
in interface LongIterable
min
in class AbstractLazyLongIterable
public long minIfEmpty(long defaultValue)
minIfEmpty
in interface LongIterable
minIfEmpty
in class AbstractLazyLongIterable
public long maxIfEmpty(long defaultValue)
maxIfEmpty
in interface LongIterable
maxIfEmpty
in class AbstractLazyLongIterable
public double average()
average
in interface LongIterable
average
in class AbstractLazyLongIterable
public double median()
median
in interface LongIterable
median
in class AbstractLazyLongIterable
public long[] toSortedArray()
toSortedArray
in interface LongIterable
toSortedArray
in class AbstractLazyLongIterable
public MutableLongList toSortedList()
toSortedList
in interface LongIterable
toSortedList
in class AbstractLazyLongIterable
public long[] toArray()
LongIterable
toArray
in interface LongIterable
toArray
in class AbstractLazyLongIterable
public String toString()
PrimitiveIterable
Assert.assertEquals("[]", IntLists.mutable.empty().toString()); Assert.assertEquals("[1]", IntLists.mutable.with(1).toString()); Assert.assertEquals("[1, 2, 3]", IntLists.mutable.with(1, 2, 3).toString());
toString
in interface PrimitiveIterable
toString
in class AbstractLazyLongIterable
AbstractCollection.toString()
public String makeString()
PrimitiveIterable
PrimitiveIterable.makeString(String)
and defaulting
the separator parameter to the characters ", " (comma and space).makeString
in interface PrimitiveIterable
makeString
in class AbstractLazyLongIterable
public String makeString(String separator)
PrimitiveIterable
PrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String).makeString
in interface PrimitiveIterable
makeString
in class AbstractLazyLongIterable
public String makeString(String start, String separator, String end)
PrimitiveIterable
makeString
in interface PrimitiveIterable
makeString
in class AbstractLazyLongIterable
public void appendString(Appendable appendable)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString()
.appendString
in interface PrimitiveIterable
appendString
in class AbstractLazyLongIterable
public void appendString(Appendable appendable, String separator)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString(String)
.appendString
in interface PrimitiveIterable
appendString
in class AbstractLazyLongIterable
public void appendString(Appendable appendable, String start, String separator, String end)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString(String, String, String)
.appendString
in interface PrimitiveIterable
appendString
in class AbstractLazyLongIterable
public boolean contains(long value)
LongIterable
contains
in interface LongIterable
contains
in class AbstractLazyLongIterable
public boolean containsAll(long... source)
LongIterable
containsAll
in interface LongIterable
containsAll
in class AbstractLazyLongIterable
public boolean containsAll(LongIterable source)
LongIterable
containsAll
in interface LongIterable
containsAll
in class AbstractLazyLongIterable
public MutableLongList toList()
LongIterable
toList
in interface LongIterable
toList
in class AbstractLazyLongIterable
public MutableLongSet toSet()
LongIterable
toSet
in interface LongIterable
toSet
in class AbstractLazyLongIterable
public MutableLongBag toBag()
LongIterable
toBag
in interface LongIterable
toBag
in class AbstractLazyLongIterable
public <T> T injectInto(T injectedValue, ObjectLongToObjectFunction<? super T,? extends T> function)
injectInto
in interface LongIterable
injectInto
in class AbstractLazyLongIterable
Copyright © 2004–2017. All rights reserved.