Serializable, CharSequence, CharIterable, ImmutableCharCollection, CharList, ImmutableCharList, OrderedCharIterable, ReversibleCharIterable, PrimitiveIterablepublic 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, toSortedListasLazy, average, averageIfEmpty, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, flatCollect, maxIfEmpty, median, medianIfEmpty, minIfEmpty, reduce, reduceIfEmpty, reject, select, summaryStatistics, toSortedArray, toSortedListchars, codePointscollectWithIndex, tapcollectWithIndexappendString, appendString, isEmpty, makeString, makeString, makeString, notEmptypublic 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 CharSequencepublic int length()
length in interface CharSequencepublic String subSequence(int start, int end)
subSequence in interface CharSequencepublic StringBuilder toStringBuilder()
public String toString()
toString in interface CharSequencetoString in interface PrimitiveIterabletoString in class AbstractCharIterableAbstractCollection.toString()public CharIterator charIterator()
CharIterablecharIterator in interface CharIterablepublic char[] toArray()
CharIterabletoArray in interface CharIterablepublic boolean contains(char expected)
CharIterablecontains in interface CharIterablepublic void forEach(CharProcedure procedure)
CharIterableforEach in interface CharIterablepublic void each(CharProcedure procedure)
CharIterableeach in interface CharIterablepublic CharAdapter distinct()
distinct in interface CharListdistinct in interface ImmutableCharListdistinct in interface ReversibleCharIterablepublic CharAdapter newWith(char element)
newWith in interface ImmutableCharCollectionnewWith in interface ImmutableCharListpublic CharAdapter newWithout(char element)
newWithout in interface ImmutableCharCollectionnewWithout in interface ImmutableCharListpublic CharAdapter newWithAll(CharIterable elements)
newWithAll in interface ImmutableCharCollectionnewWithAll in interface ImmutableCharListpublic CharAdapter newWithoutAll(CharIterable elements)
newWithoutAll in interface ImmutableCharCollectionnewWithoutAll in interface ImmutableCharListpublic CharAdapter toReversed()
toReversed in interface CharListtoReversed in interface ImmutableCharListtoReversed in interface ReversibleCharIterablepublic ImmutableCharList subList(int fromIndex, int toIndex)
subList in interface CharListsubList in interface ImmutableCharListList.subList(int fromIndex, int toIndex)public Character getCharacter(int index)
public long dotProduct(CharList list)
dotProduct in interface CharListpublic int binarySearch(char value)
binarySearch in interface CharListpublic int lastIndexOf(char value)
lastIndexOf in interface CharListpublic ImmutableCharList toImmutable()
CharListtoImmutable in interface CharListpublic char getLast()
getLast in interface ReversibleCharIterablepublic LazyCharIterable asReversed()
asReversed in interface ReversibleCharIterablepublic <T> T injectIntoWithIndex(T injectedValue,
ObjectCharIntToObjectFunction<? super T,? extends T> function)
injectIntoWithIndex in interface OrderedCharIterableinjectIntoWithIndex in interface ReversibleCharIterablepublic char getFirst()
getFirst in interface OrderedCharIterablepublic int indexOf(char value)
indexOf in interface OrderedCharIterablepublic void forEachWithIndex(CharIntProcedure procedure)
forEachWithIndex in interface OrderedCharIterablepublic CharAdapter select(CharPredicate predicate)
CharIterableselect in interface CharIterableselect in interface CharListselect in interface ImmutableCharCollectionselect in interface ImmutableCharListselect in interface OrderedCharIterableselect in interface ReversibleCharIterablepublic CharAdapter reject(CharPredicate predicate)
CharIterablereject in interface CharIterablereject in interface CharListreject in interface ImmutableCharCollectionreject in interface ImmutableCharListreject in interface OrderedCharIterablereject in interface ReversibleCharIterablepublic <V> ImmutableList<V> collect(CharToObjectFunction<? extends V> function)
CharIterablecollect in interface CharIterablecollect in interface CharListcollect in interface ImmutableCharCollectioncollect in interface ImmutableCharListcollect in interface OrderedCharIterablecollect in interface ReversibleCharIterablepublic CharAdapter collectChar(CharToCharFunction function)
public char detectIfNone(CharPredicate predicate, char ifNone)
detectIfNone in interface CharIterablepublic int count(CharPredicate predicate)
CharIterablecount in interface CharIterablepublic boolean anySatisfy(CharPredicate predicate)
CharIterableanySatisfy in interface CharIterablepublic boolean allSatisfy(CharPredicate predicate)
CharIterableallSatisfy in interface CharIterablepublic boolean noneSatisfy(CharPredicate predicate)
CharIterablenoneSatisfy in interface CharIterablepublic MutableCharList toList()
CharIterabletoList in interface CharIterabletoList in class AbstractCharIterablepublic MutableCharSet toSet()
CharIterabletoSet in interface CharIterabletoSet in class AbstractCharIterablepublic MutableCharBag toBag()
CharIterabletoBag in interface CharIterabletoBag in class AbstractCharIterablepublic <T> T injectInto(T injectedValue,
ObjectCharToObjectFunction<? super T,? extends T> function)
injectInto in interface CharIterablepublic RichIterable<CharIterable> chunk(int size)
CharIterablechunk in interface CharIterablesize - the number of elements per chunkRichIterable containing CharIterables of size size, except the last will be
truncated if the elements don't divide evenly.public long sum()
sum in interface CharIterablepublic char max()
max in interface CharIterablepublic char min()
min in interface CharIterablepublic int size()
PrimitiveIterablesize in interface PrimitiveIterablepublic void appendString(Appendable appendable, String start, String separator, String end)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String, String, String).appendString in interface PrimitiveIterablepublic boolean equals(Object otherList)
CharListList.equals(Object).public int hashCode()
CharListList.hashCode().public ImmutableList<CharCharPair> zipChar(CharIterable iterable)
ImmutableCharListImmutableList formed from this ImmutableCharList and another CharList by
combining corresponding elements in pairs. If one of the two CharLists is longer than the other, its
remaining elements are ignored.zipChar in interface CharListzipChar in interface ImmutableCharListpublic <T> ImmutableList<CharObjectPair<T>> zip(Iterable<T> iterable)
ImmutableCharListImmutableList 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 CharListzip in interface ImmutableCharListCopyright © 2004–2019. All rights reserved.