CharIterable
, OrderedCharIterable
, PrimitiveIterable
, CharStack
CharArrayStack
public abstract class AbstractCharStack extends Object implements CharStack
Constructor | Description |
---|---|
AbstractCharStack() |
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 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 . |
LazyCharIterable |
asLazy() |
Returns a LazyCharIterable adapter wrapping the source CharIterable.
|
double |
average() |
|
CharIterator |
charIterator() |
Returns a primitive iterator that can be used to iterate over the CharIterable in an
imperative style.
|
RichIterable<CharIterable> |
chunk(int size) |
Partitions elements in fixed size chunks.
|
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) |
|
void |
each(CharProcedure procedure) |
A synonym for forEach.
|
boolean |
equals(Object otherStack) |
Follows the same general contract as
StackIterable.equals(Object) . |
void |
forEach(CharProcedure procedure) |
Applies the CharProcedure to each element in the CharIterable.
|
void |
forEachWithIndex(CharIntProcedure procedure) |
|
char |
getFirst() |
|
int |
hashCode() |
Follows the same general contract as
StackIterable.hashCode() . |
int |
indexOf(char value) |
|
<V> V |
injectInto(V injectedValue,
ObjectCharToObjectFunction<? super V,? extends V> function) |
|
<T> T |
injectIntoWithIndex(T injectedValue,
ObjectCharIntToObjectFunction<? super T,? extends T> function) |
|
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.
|
char |
max() |
|
char |
maxIfEmpty(char defaultValue) |
|
double |
median() |
|
char |
min() |
|
char |
minIfEmpty(char defaultValue) |
|
boolean |
noneSatisfy(CharPredicate predicate) |
Returns true if none of the elements in the CharIterable return true for the
specified predicate, otherwise returns false.
|
char |
peek() |
Returns the top of the stack.
|
CharList |
peek(int count) |
Returns CharList of the number of elements specified by the count, beginning with the top of the stack.
|
char |
peekAt(int index) |
Returns the element at the specified index.
|
int |
size() |
Returns the number of items in this iterable.
|
long |
sum() |
|
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() |
|
String |
toString() |
Returns a string with the elements of this iterable separated by commas with spaces and
enclosed in square brackets.
|
averageIfEmpty, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, flatCollect, medianIfEmpty, reduce, reduceIfEmpty, reject, select, summaryStatistics, toSortedList
collect, collectWithIndex, reject, select, tap, toImmutable
collectWithIndex
isEmpty, notEmpty
public char peek()
CharStack
public CharList peek(int count)
CharStack
public char peekAt(int index)
CharStack
public void forEach(CharProcedure procedure)
CharIterable
forEach
in interface CharIterable
public CharIterator charIterator()
CharIterable
charIterator
in interface CharIterable
public void each(CharProcedure procedure)
CharIterable
each
in interface CharIterable
public int count(CharPredicate predicate)
CharIterable
count
in interface CharIterable
public boolean anySatisfy(CharPredicate predicate)
CharIterable
anySatisfy
in interface CharIterable
public boolean allSatisfy(CharPredicate predicate)
CharIterable
allSatisfy
in interface CharIterable
public boolean noneSatisfy(CharPredicate predicate)
CharIterable
noneSatisfy
in interface CharIterable
public char detectIfNone(CharPredicate predicate, char ifNone)
detectIfNone
in interface CharIterable
public char[] toArray()
CharIterable
toArray
in interface CharIterable
public boolean contains(char value)
CharIterable
contains
in interface CharIterable
public boolean containsAll(char... source)
CharIterable
containsAll
in interface CharIterable
public boolean containsAll(CharIterable source)
CharIterable
containsAll
in interface CharIterable
public MutableCharList toList()
CharIterable
toList
in interface CharIterable
public MutableCharSet toSet()
CharIterable
toSet
in interface CharIterable
public MutableCharBag toBag()
CharIterable
toBag
in interface CharIterable
public <V> V injectInto(V injectedValue, ObjectCharToObjectFunction<? super V,? extends V> function)
injectInto
in interface CharIterable
public LazyCharIterable asLazy()
CharIterable
asLazy
in interface CharIterable
public int size()
PrimitiveIterable
size
in interface PrimitiveIterable
public boolean equals(Object otherStack)
CharStack
StackIterable.equals(Object)
.public int hashCode()
CharStack
StackIterable.hashCode()
.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 Object
AbstractCollection.toString()
public String makeString()
PrimitiveIterable
PrimitiveIterable.makeString(String)
and defaulting
the separator parameter to the characters ", "
(comma and space).makeString
in interface PrimitiveIterable
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
public String makeString(String start, String separator, String end)
PrimitiveIterable
makeString
in interface PrimitiveIterable
public void appendString(Appendable appendable)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString()
.appendString
in interface PrimitiveIterable
public void appendString(Appendable appendable, String separator)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString(String)
.appendString
in interface PrimitiveIterable
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
public char getFirst()
getFirst
in interface OrderedCharIterable
public int indexOf(char value)
indexOf
in interface OrderedCharIterable
public <T> T injectIntoWithIndex(T injectedValue, ObjectCharIntToObjectFunction<? super T,? extends T> function)
injectIntoWithIndex
in interface OrderedCharIterable
public void forEachWithIndex(CharIntProcedure procedure)
forEachWithIndex
in interface OrderedCharIterable
public RichIterable<CharIterable> chunk(int size)
CharIterable
chunk
in interface CharIterable
size
- the number of elements per chunkRichIterable
containing CharIterable
s of size size
, except the last will be
truncated if the elements don't divide evenly.public long sum()
sum
in interface CharIterable
public char max()
max
in interface CharIterable
public char min()
min
in interface CharIterable
public char minIfEmpty(char defaultValue)
minIfEmpty
in interface CharIterable
public char maxIfEmpty(char defaultValue)
maxIfEmpty
in interface CharIterable
public double average()
average
in interface CharIterable
public double median()
median
in interface CharIterable
public char[] toSortedArray()
toSortedArray
in interface CharIterable
Copyright © 2004–2019. All rights reserved.