Class AbstractLazyCharIterable
java.lang.Object
org.eclipse.collections.impl.lazy.primitive.AbstractLazyCharIterable
- All Implemented Interfaces:
CharIterable
,LazyCharIterable
,PrimitiveIterable
- Direct Known Subclasses:
CollectBooleanToCharIterable
,CollectByteToCharIterable
,CollectCharIterable
,CollectCharToCharIterable
,CollectDoubleToCharIterable
,CollectFloatToCharIterable
,CollectIntToCharIterable
,CollectLongToCharIterable
,CollectShortToCharIterable
,LazyCharIterableAdapter
,ReverseCharIterable
,SelectCharIterable
,TapCharIterable
public abstract class AbstractLazyCharIterable extends Object implements LazyCharIterable
This file was automatically generated from template file abstractLazyPrimitiveIterable.stg.
- Since:
- 5.0
-
Constructor Summary
Constructors Constructor Description AbstractLazyCharIterable()
-
Method Summary
Modifier and Type Method Description boolean
allSatisfy(CharPredicate predicate)
Returns true if all of the elements in the CharIterable return true for the specified predicate, otherwise returns false.boolean
anySatisfy(CharPredicate predicate)
Returns true if any of the elements in the CharIterable return true for the specified predicate, otherwise returns false.void
appendString(Appendable appendable)
Prints a string representation of this collection onto the givenAppendable
.void
appendString(Appendable appendable, String separator)
Prints a string representation of this collection onto the givenAppendable
.void
appendString(Appendable appendable, String start, String separator, String end)
Prints a string representation of this collection onto the givenAppendable
.LazyCharIterable
asLazy()
Returns a LazyCharIterable adapter wrapping the source CharIterable.double
average()
RichIterable<CharIterable>
chunk(int size)
Partitions elements in fixed size chunks.<V> LazyIterable<V>
collect(CharToObjectFunction<? extends V> function)
Returns a new collection with the results of applying the specified function on each element of the source collection.LazyBooleanIterable
collectBoolean(CharToBooleanFunction function)
LazyByteIterable
collectByte(CharToByteFunction function)
LazyCharIterable
collectChar(CharToCharFunction function)
LazyDoubleIterable
collectDouble(CharToDoubleFunction function)
LazyFloatIterable
collectFloat(CharToFloatFunction function)
LazyIntIterable
collectInt(CharToIntFunction function)
LazyLongIterable
collectLong(CharToLongFunction function)
LazyShortIterable
collectShort(CharToShortFunction function)
boolean
contains(char value)
Returns true if the value is contained in the CharIterable, and false if it is not.boolean
containsAll(char... source)
Returns true if the all of the values specified in the source array are contained in the CharIterable, and false if they are not.boolean
containsAll(CharIterable source)
Returns true if the all of the values specified in the source CharIterable are contained in the CharIterable, and false if they are not.int
count(CharPredicate predicate)
Returns a count of the number of elements in the CharIterable that return true for the specified predicate.char
detectIfNone(CharPredicate predicate, char ifNone)
<V> LazyIterable<V>
flatCollect(CharToObjectFunction<? extends Iterable<V>> function)
void
forEach(CharProcedure procedure)
Applies the CharProcedure to each element in the CharIterable.<T> T
injectInto(T injectedValue, ObjectCharToObjectFunction<? super T,? extends T> function)
boolean
isEmpty()
Returns true if this iterable has zero items.String
makeString()
Returns a string representation of this collection by delegating toPrimitiveIterable.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 toPrimitiveIterable.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.char
max()
char
maxIfEmpty(char ifEmpty)
double
median()
char
min()
char
minIfEmpty(char ifEmpty)
boolean
noneSatisfy(CharPredicate predicate)
Returns true if none of the elements in the CharIterable return true for the specified predicate, otherwise returns false.boolean
notEmpty()
The English equivalent of !this.isEmpty()LazyCharIterable
reject(CharPredicate predicate)
Returns a new CharIterable with all of the elements in the CharIterable that return false for the specified predicate.LazyCharIterable
select(CharPredicate predicate)
Returns a new CharIterable with all of the elements in the CharIterable that return true for the specified predicate.int
size()
Returns the number of items in this iterable.long
sum()
LazyCharIterable
tap(CharProcedure procedure)
char[]
toArray()
Converts the CharIterable to a primitive char array.MutableCharBag
toBag()
Converts the CharIterable to a new MutableCharBag.MutableCharList
toList()
Converts the CharIterable to a new MutableCharList.MutableCharSet
toSet()
Converts the CharIterable to a new MutableCharSet.char[]
toSortedArray()
MutableCharList
toSortedList()
String
toString()
Returns a string with the elements of this iterable separated by commas with spaces and enclosed in square brackets.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.collections.api.CharIterable
averageIfEmpty, charIterator, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, each, flatCollect, medianIfEmpty, reduce, reduceIfEmpty, reject, select, summaryStatistics, toArray
-
Constructor Details
-
AbstractLazyCharIterable
public AbstractLazyCharIterable()
-
-
Method Details
-
forEach
Description copied from interface:CharIterable
Applies the CharProcedure to each element in the CharIterable.- Specified by:
forEach
in interfaceCharIterable
-
size
public int size()Description copied from interface:PrimitiveIterable
Returns the number of items in this iterable.- Specified by:
size
in interfacePrimitiveIterable
-
toString
Description copied from interface:PrimitiveIterable
Returns a string with the elements of this iterable separated by commas with spaces and enclosed in square brackets.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());
- Specified by:
toString
in interfacePrimitiveIterable
- Overrides:
toString
in classObject
- Returns:
- a string representation of this PrimitiveIterable
- See Also:
AbstractCollection.toString()
-
isEmpty
public boolean isEmpty()Description copied from interface:PrimitiveIterable
Returns true if this iterable has zero items.- Specified by:
isEmpty
in interfacePrimitiveIterable
-
notEmpty
public boolean notEmpty()Description copied from interface:PrimitiveIterable
The English equivalent of !this.isEmpty()- Specified by:
notEmpty
in interfacePrimitiveIterable
-
makeString
Description copied from interface:PrimitiveIterable
Returns a string representation of this collection by delegating toPrimitiveIterable.makeString(String)
and defaulting the separator parameter to the characters", "
(comma and space).- Specified by:
makeString
in interfacePrimitiveIterable
- Returns:
- a string representation of this collection.
-
makeString
Description copied from interface:PrimitiveIterable
Returns a string representation of this collection by delegating toPrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to""
(the empty String).- Specified by:
makeString
in interfacePrimitiveIterable
- Returns:
- a string representation of this collection.
-
makeString
Description copied from interface:PrimitiveIterable
Returns a string representation of this collection with the elements separated by the specified separator and enclosed between the start and end strings.- Specified by:
makeString
in interfacePrimitiveIterable
- Returns:
- a string representation of this collection.
-
appendString
Description copied from interface:PrimitiveIterable
Prints a string representation of this collection onto the givenAppendable
. Prints the string returned byPrimitiveIterable.makeString()
.- Specified by:
appendString
in interfacePrimitiveIterable
-
appendString
Description copied from interface:PrimitiveIterable
Prints a string representation of this collection onto the givenAppendable
. Prints the string returned byPrimitiveIterable.makeString(String)
.- Specified by:
appendString
in interfacePrimitiveIterable
-
appendString
Description copied from interface:PrimitiveIterable
Prints a string representation of this collection onto the givenAppendable
. Prints the string returned byPrimitiveIterable.makeString(String, String, String)
.- Specified by:
appendString
in interfacePrimitiveIterable
-
contains
public boolean contains(char value)Description copied from interface:CharIterable
Returns true if the value is contained in the CharIterable, and false if it is not.- Specified by:
contains
in interfaceCharIterable
-
containsAll
public boolean containsAll(char... source)Description copied from interface:CharIterable
Returns true if the all of the values specified in the source array are contained in the CharIterable, and false if they are not.- Specified by:
containsAll
in interfaceCharIterable
-
containsAll
Description copied from interface:CharIterable
Returns true if the all of the values specified in the source CharIterable are contained in the CharIterable, and false if they are not.- Specified by:
containsAll
in interfaceCharIterable
-
select
Description copied from interface:CharIterable
Returns a new CharIterable with all of the elements in the CharIterable that return true for the specified predicate.- Specified by:
select
in interfaceCharIterable
- Specified by:
select
in interfaceLazyCharIterable
-
reject
Description copied from interface:CharIterable
Returns a new CharIterable with all of the elements in the CharIterable that return false for the specified predicate.- Specified by:
reject
in interfaceCharIterable
- Specified by:
reject
in interfaceLazyCharIterable
-
tap
- Specified by:
tap
in interfaceCharIterable
- Specified by:
tap
in interfaceLazyCharIterable
-
collect
Description copied from interface:CharIterable
Returns a new collection with the results of applying the specified function on each element of the source collection. This method is also commonly called transform or map.- Specified by:
collect
in interfaceCharIterable
- Specified by:
collect
in interfaceLazyCharIterable
-
flatCollect
- Specified by:
flatCollect
in interfaceLazyCharIterable
-
collectBoolean
- Specified by:
collectBoolean
in interfaceLazyCharIterable
- Since:
- 7.0
-
collectByte
- Specified by:
collectByte
in interfaceLazyCharIterable
- Since:
- 7.0
-
collectChar
- Specified by:
collectChar
in interfaceLazyCharIterable
- Since:
- 7.0
-
collectShort
- Specified by:
collectShort
in interfaceLazyCharIterable
- Since:
- 7.0
-
collectInt
- Specified by:
collectInt
in interfaceLazyCharIterable
- Since:
- 7.0
-
collectFloat
- Specified by:
collectFloat
in interfaceLazyCharIterable
- Since:
- 7.0
-
collectLong
- Specified by:
collectLong
in interfaceLazyCharIterable
- Since:
- 7.0
-
collectDouble
- Specified by:
collectDouble
in interfaceLazyCharIterable
- Since:
- 7.0
-
detectIfNone
- Specified by:
detectIfNone
in interfaceCharIterable
-
count
Description copied from interface:CharIterable
Returns a count of the number of elements in the CharIterable that return true for the specified predicate.- Specified by:
count
in interfaceCharIterable
-
anySatisfy
Description copied from interface:CharIterable
Returns true if any of the elements in the CharIterable return true for the specified predicate, otherwise returns false.- Specified by:
anySatisfy
in interfaceCharIterable
-
allSatisfy
Description copied from interface:CharIterable
Returns true if all of the elements in the CharIterable return true for the specified predicate, otherwise returns false.- Specified by:
allSatisfy
in interfaceCharIterable
-
noneSatisfy
Description copied from interface:CharIterable
Returns true if none of the elements in the CharIterable return true for the specified predicate, otherwise returns false.- Specified by:
noneSatisfy
in interfaceCharIterable
-
injectInto
public <T> T injectInto(T injectedValue, ObjectCharToObjectFunction<? super T,? extends T> function)- Specified by:
injectInto
in interfaceCharIterable
-
chunk
Description copied from interface:CharIterable
Partitions elements in fixed size chunks.- Specified by:
chunk
in interfaceCharIterable
- Parameters:
size
- the number of elements per chunk- Returns:
- A
RichIterable
containingCharIterable
s of sizesize
, except the last will be truncated if the elements don't divide evenly.
-
toArray
public char[] toArray()Description copied from interface:CharIterable
Converts the CharIterable to a primitive char array.- Specified by:
toArray
in interfaceCharIterable
-
toList
Description copied from interface:CharIterable
Converts the CharIterable to a new MutableCharList.- Specified by:
toList
in interfaceCharIterable
-
toSet
Description copied from interface:CharIterable
Converts the CharIterable to a new MutableCharSet.- Specified by:
toSet
in interfaceCharIterable
-
toBag
Description copied from interface:CharIterable
Converts the CharIterable to a new MutableCharBag.- Specified by:
toBag
in interfaceCharIterable
-
sum
public long sum()- Specified by:
sum
in interfaceCharIterable
-
max
public char max()- Specified by:
max
in interfaceCharIterable
-
maxIfEmpty
public char maxIfEmpty(char ifEmpty)- Specified by:
maxIfEmpty
in interfaceCharIterable
-
min
public char min()- Specified by:
min
in interfaceCharIterable
-
minIfEmpty
public char minIfEmpty(char ifEmpty)- Specified by:
minIfEmpty
in interfaceCharIterable
-
average
public double average()- Specified by:
average
in interfaceCharIterable
-
median
public double median()- Specified by:
median
in interfaceCharIterable
-
toSortedArray
public char[] toSortedArray()- Specified by:
toSortedArray
in interfaceCharIterable
-
toSortedList
- Specified by:
toSortedList
in interfaceCharIterable
-
asLazy
Description copied from interface:CharIterable
Returns a LazyCharIterable adapter wrapping the source CharIterable.- Specified by:
asLazy
in interfaceCharIterable
-