IntIterable
, LazyIntIterable
, PrimitiveIterable
public class LazyIntIterableAdapter extends AbstractLazyIntIterable
Constructor | Description |
---|---|
LazyIntIterableAdapter(IntIterable delegate) |
Modifier and Type | Method | Description |
---|---|---|
boolean |
allSatisfy(IntPredicate predicate) |
Returns true if all of the elements in the IntIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
anySatisfy(IntPredicate predicate) |
Returns true if any of the elements in the IntIterable 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(int value) |
Returns true if the value is contained in the IntIterable, and false if it is not.
|
boolean |
containsAll(int... source) |
Returns true if the all of the values specified in the source array are contained
in the IntIterable, and false if they are not.
|
boolean |
containsAll(IntIterable source) |
Returns true if the all of the values specified in the source IntIterable are contained
in the IntIterable, and false if they are not.
|
int |
count(IntPredicate predicate) |
Returns a count of the number of elements in the IntIterable that return true for the
specified predicate.
|
int |
detectIfNone(IntPredicate predicate,
int ifNone) |
|
void |
each(IntProcedure procedure) |
A synonym for forEach.
|
<T> T |
injectInto(T injectedValue,
ObjectIntToObjectFunction<? super T,? extends T> function) |
|
IntIterator |
intIterator() |
Returns a primitive iterator that can be used to iterate over the IntIterable in an
imperative style.
|
boolean |
isEmpty() |
Returns true if this iterable has zero items.
|
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.
|
int |
max() |
|
int |
maxIfEmpty(int defaultValue) |
|
double |
median() |
|
int |
min() |
|
int |
minIfEmpty(int defaultValue) |
|
boolean |
noneSatisfy(IntPredicate predicate) |
Returns true if none of the elements in the IntIterable 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() |
|
int[] |
toArray() |
Converts the IntIterable to a primitive int array.
|
MutableIntBag |
toBag() |
Converts the IntIterable to a new MutableIntBag.
|
MutableIntList |
toList() |
Converts the IntIterable to a new MutableIntList.
|
MutableIntSet |
toSet() |
Converts the IntIterable to a new MutableIntSet.
|
int[] |
toSortedArray() |
|
MutableIntList |
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 LazyIntIterableAdapter(IntIterable delegate)
public IntIterator intIterator()
IntIterable
public void each(IntProcedure procedure)
IntIterable
public int size()
PrimitiveIterable
size
in interface PrimitiveIterable
size
in class AbstractLazyIntIterable
public boolean isEmpty()
PrimitiveIterable
isEmpty
in interface PrimitiveIterable
isEmpty
in class AbstractLazyIntIterable
public boolean notEmpty()
PrimitiveIterable
notEmpty
in interface PrimitiveIterable
notEmpty
in class AbstractLazyIntIterable
public int count(IntPredicate predicate)
IntIterable
count
in interface IntIterable
count
in class AbstractLazyIntIterable
public boolean anySatisfy(IntPredicate predicate)
IntIterable
anySatisfy
in interface IntIterable
anySatisfy
in class AbstractLazyIntIterable
public boolean allSatisfy(IntPredicate predicate)
IntIterable
allSatisfy
in interface IntIterable
allSatisfy
in class AbstractLazyIntIterable
public boolean noneSatisfy(IntPredicate predicate)
IntIterable
noneSatisfy
in interface IntIterable
noneSatisfy
in class AbstractLazyIntIterable
public int detectIfNone(IntPredicate predicate, int ifNone)
detectIfNone
in interface IntIterable
detectIfNone
in class AbstractLazyIntIterable
public long sum()
sum
in interface IntIterable
sum
in class AbstractLazyIntIterable
public int max()
max
in interface IntIterable
max
in class AbstractLazyIntIterable
public int min()
min
in interface IntIterable
min
in class AbstractLazyIntIterable
public int minIfEmpty(int defaultValue)
minIfEmpty
in interface IntIterable
minIfEmpty
in class AbstractLazyIntIterable
public int maxIfEmpty(int defaultValue)
maxIfEmpty
in interface IntIterable
maxIfEmpty
in class AbstractLazyIntIterable
public double average()
average
in interface IntIterable
average
in class AbstractLazyIntIterable
public double median()
median
in interface IntIterable
median
in class AbstractLazyIntIterable
public int[] toSortedArray()
toSortedArray
in interface IntIterable
toSortedArray
in class AbstractLazyIntIterable
public MutableIntList toSortedList()
toSortedList
in interface IntIterable
toSortedList
in class AbstractLazyIntIterable
public int[] toArray()
IntIterable
toArray
in interface IntIterable
toArray
in class AbstractLazyIntIterable
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 AbstractLazyIntIterable
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 AbstractLazyIntIterable
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 AbstractLazyIntIterable
public String makeString(String start, String separator, String end)
PrimitiveIterable
makeString
in interface PrimitiveIterable
makeString
in class AbstractLazyIntIterable
public void appendString(Appendable appendable)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString()
.appendString
in interface PrimitiveIterable
appendString
in class AbstractLazyIntIterable
public void appendString(Appendable appendable, String separator)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString(String)
.appendString
in interface PrimitiveIterable
appendString
in class AbstractLazyIntIterable
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 AbstractLazyIntIterable
public boolean contains(int value)
IntIterable
contains
in interface IntIterable
contains
in class AbstractLazyIntIterable
public boolean containsAll(int... source)
IntIterable
containsAll
in interface IntIterable
containsAll
in class AbstractLazyIntIterable
public boolean containsAll(IntIterable source)
IntIterable
containsAll
in interface IntIterable
containsAll
in class AbstractLazyIntIterable
public MutableIntList toList()
IntIterable
toList
in interface IntIterable
toList
in class AbstractLazyIntIterable
public MutableIntSet toSet()
IntIterable
toSet
in interface IntIterable
toSet
in class AbstractLazyIntIterable
public MutableIntBag toBag()
IntIterable
toBag
in interface IntIterable
toBag
in class AbstractLazyIntIterable
public <T> T injectInto(T injectedValue, ObjectIntToObjectFunction<? super T,? extends T> function)
injectInto
in interface IntIterable
injectInto
in class AbstractLazyIntIterable
Copyright © 2004–2017. All rights reserved.