Serializable
, CharSequence
, CharIterable
, ImmutableCharCollection
, CharList
, ImmutableCharList
, OrderedCharIterable
, ReversibleCharIterable
, PrimitiveIterable
public class CharAdapter extends AbstractCharIterable implements CharSequence, ImmutableCharList, Serializable
Constructor | Description |
---|---|
CharAdapter(String value) |
Modifier and Type | Method | Description |
---|---|---|
static CharAdapter |
adapt(String value) |
|
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,
String start,
String separator,
String end) |
Prints a string representation of this collection onto the given
Appendable . |
LazyCharIterable |
asReversed() |
|
int |
binarySearch(char value) |
|
char |
charAt(int index) |
|
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.
|
<V> ImmutableList<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.
|
CharAdapter |
collectChar(CharToCharFunction function) |
|
boolean |
contains(char expected) |
Returns true if the value is contained in the CharIterable, and false if it is 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) |
|
CharAdapter |
distinct() |
|
long |
dotProduct(CharList list) |
|
void |
each(CharProcedure procedure) |
A synonym for forEach.
|
boolean |
equals(Object otherList) |
Follows the same general contract as
List.equals(Object) . |
void |
forEach(CharProcedure procedure) |
Applies the CharProcedure to each element in the CharIterable.
|
void |
forEachWithIndex(CharIntProcedure procedure) |
|
static CharAdapter |
from(char... chars) |
|
static CharAdapter |
from(CharIterable iterable) |
|
char |
get(int index) |
|
Character |
getCharacter(int index) |
|
char |
getFirst() |
|
char |
getLast() |
|
int |
hashCode() |
Follows the same general contract as
List.hashCode() . |
int |
indexOf(char value) |
|
<T> T |
injectInto(T injectedValue,
ObjectCharToObjectFunction<? super T,? extends T> function) |
|
<T> T |
injectIntoWithIndex(T injectedValue,
ObjectCharIntToObjectFunction<? super T,? extends T> function) |
|
int |
lastIndexOf(char value) |
|
int |
length() |
|
char |
max() |
|
char |
min() |
|
CharAdapter |
newWith(char element) |
|
CharAdapter |
newWithAll(CharIterable elements) |
|
CharAdapter |
newWithout(char element) |
|
CharAdapter |
newWithoutAll(CharIterable elements) |
|
boolean |
noneSatisfy(CharPredicate predicate) |
Returns true if none of the elements in the CharIterable return true for the
specified predicate, otherwise returns false.
|
CharAdapter |
reject(CharPredicate predicate) |
Returns a new CharIterable with all of the elements in the CharIterable that
return false for the specified predicate.
|
CharAdapter |
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.
|
ImmutableCharList |
subList(int fromIndex,
int toIndex) |
|
String |
subSequence(int start,
int end) |
|
long |
sum() |
|
char[] |
toArray() |
Converts the CharIterable to a primitive char array.
|
MutableCharBag |
toBag() |
Converts the CharIterable to a new MutableCharBag.
|
ImmutableCharList |
toImmutable() |
Returns an immutable copy of this list.
|
MutableCharList |
toList() |
Converts the CharIterable to a new MutableCharList.
|
CharAdapter |
toReversed() |
|
MutableCharSet |
toSet() |
Converts the CharIterable to a new MutableCharSet.
|
String |
toString() |
The value of toString must be strictly implemented as defined in CharSequence.
|
StringBuilder |
toStringBuilder() |
|
<T> ImmutableList<CharObjectPair<T>> |
zip(Iterable<T> iterable) |
Returns an
ImmutableList formed from this ImmutableCharList and a ListIterable by
combining corresponding elements in pairs. |
ImmutableList<CharCharPair> |
zipChar(CharIterable iterable) |
Returns an
ImmutableList formed from this ImmutableCharList and another CharList by
combining corresponding elements in pairs. |
asLazy, average, containsAll, containsAll, maxIfEmpty, median, minIfEmpty, toSortedArray, toSortedList
asLazy, average, averageIfEmpty, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, flatCollect, maxIfEmpty, median, medianIfEmpty, minIfEmpty, reduce, reduceIfEmpty, reject, select, summaryStatistics, toSortedArray, toSortedList
chars, codePoints
collectWithIndex, tap
collectWithIndex
appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty
public CharAdapter(String value)
public static CharAdapter adapt(String value)
public static CharAdapter from(char... chars)
public static CharAdapter from(CharIterable iterable)
public char charAt(int index)
charAt
in interface CharSequence
public int length()
length
in interface CharSequence
public String subSequence(int start, int end)
subSequence
in interface CharSequence
public StringBuilder toStringBuilder()
public String toString()
toString
in interface CharSequence
toString
in interface PrimitiveIterable
toString
in class AbstractCharIterable
AbstractCollection.toString()
public CharIterator charIterator()
CharIterable
charIterator
in interface CharIterable
public char[] toArray()
CharIterable
toArray
in interface CharIterable
public boolean contains(char expected)
CharIterable
contains
in interface CharIterable
public void forEach(CharProcedure procedure)
CharIterable
forEach
in interface CharIterable
public void each(CharProcedure procedure)
CharIterable
each
in interface CharIterable
public CharAdapter distinct()
distinct
in interface CharList
distinct
in interface ImmutableCharList
distinct
in interface ReversibleCharIterable
public CharAdapter newWith(char element)
newWith
in interface ImmutableCharCollection
newWith
in interface ImmutableCharList
public CharAdapter newWithout(char element)
newWithout
in interface ImmutableCharCollection
newWithout
in interface ImmutableCharList
public CharAdapter newWithAll(CharIterable elements)
newWithAll
in interface ImmutableCharCollection
newWithAll
in interface ImmutableCharList
public CharAdapter newWithoutAll(CharIterable elements)
newWithoutAll
in interface ImmutableCharCollection
newWithoutAll
in interface ImmutableCharList
public CharAdapter toReversed()
toReversed
in interface CharList
toReversed
in interface ImmutableCharList
toReversed
in interface ReversibleCharIterable
public ImmutableCharList subList(int fromIndex, int toIndex)
subList
in interface CharList
subList
in interface ImmutableCharList
List.subList(int fromIndex, int toIndex)
public Character getCharacter(int index)
public long dotProduct(CharList list)
dotProduct
in interface CharList
public int binarySearch(char value)
binarySearch
in interface CharList
public int lastIndexOf(char value)
lastIndexOf
in interface CharList
public ImmutableCharList toImmutable()
CharList
toImmutable
in interface CharList
public char getLast()
getLast
in interface ReversibleCharIterable
public LazyCharIterable asReversed()
asReversed
in interface ReversibleCharIterable
public <T> T injectIntoWithIndex(T injectedValue, ObjectCharIntToObjectFunction<? super T,? extends T> function)
injectIntoWithIndex
in interface OrderedCharIterable
injectIntoWithIndex
in interface ReversibleCharIterable
public char getFirst()
getFirst
in interface OrderedCharIterable
public int indexOf(char value)
indexOf
in interface OrderedCharIterable
public void forEachWithIndex(CharIntProcedure procedure)
forEachWithIndex
in interface OrderedCharIterable
public CharAdapter select(CharPredicate predicate)
CharIterable
select
in interface CharIterable
select
in interface CharList
select
in interface ImmutableCharCollection
select
in interface ImmutableCharList
select
in interface OrderedCharIterable
select
in interface ReversibleCharIterable
public CharAdapter reject(CharPredicate predicate)
CharIterable
reject
in interface CharIterable
reject
in interface CharList
reject
in interface ImmutableCharCollection
reject
in interface ImmutableCharList
reject
in interface OrderedCharIterable
reject
in interface ReversibleCharIterable
public <V> ImmutableList<V> collect(CharToObjectFunction<? extends V> function)
CharIterable
collect
in interface CharIterable
collect
in interface CharList
collect
in interface ImmutableCharCollection
collect
in interface ImmutableCharList
collect
in interface OrderedCharIterable
collect
in interface ReversibleCharIterable
public CharAdapter collectChar(CharToCharFunction function)
public char detectIfNone(CharPredicate predicate, char ifNone)
detectIfNone
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 MutableCharList toList()
CharIterable
toList
in interface CharIterable
toList
in class AbstractCharIterable
public MutableCharSet toSet()
CharIterable
toSet
in interface CharIterable
toSet
in class AbstractCharIterable
public MutableCharBag toBag()
CharIterable
toBag
in interface CharIterable
toBag
in class AbstractCharIterable
public <T> T injectInto(T injectedValue, ObjectCharToObjectFunction<? super T,? extends T> function)
injectInto
in interface CharIterable
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 int size()
PrimitiveIterable
size
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 boolean equals(Object otherList)
CharList
List.equals(Object)
.public int hashCode()
CharList
List.hashCode()
.public ImmutableList<CharCharPair> zipChar(CharIterable iterable)
ImmutableCharList
ImmutableList
formed from this ImmutableCharList
and another CharList
by
combining corresponding elements in pairs. If one of the two CharList
s is longer than the other, its
remaining elements are ignored.zipChar
in interface CharList
zipChar
in interface ImmutableCharList
public <T> ImmutableList<CharObjectPair<T>> zip(Iterable<T> iterable)
ImmutableCharList
ImmutableList
formed from this ImmutableCharList
and a ListIterable
by
combining corresponding elements in pairs. If one of the two Lists is longer than the other, its
remaining elements are ignored.zip
in interface CharList
zip
in interface ImmutableCharList
Copyright © 2004–2019. All rights reserved.