Class CharAdapter
java.lang.Object
org.eclipse.collections.impl.primitive.AbstractCharIterable
org.eclipse.collections.impl.string.immutable.CharAdapter
- All Implemented Interfaces:
Serializable,CharSequence,CharIterable,ImmutableCharCollection,CharList,ImmutableCharList,OrderedCharIterable,ReversibleCharIterable,PrimitiveIterable
public class CharAdapter
extends AbstractCharIterable
implements CharSequence, ImmutableCharList, Serializable
Provides a view into the char[] stored in a String as an ImmutableCharList. This is a cleaner more OO way of
providing many of the iterable protocols available in StringIterate for char values.
- Since:
- 7.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CharAdapterbooleanallSatisfy(CharPredicate predicate) booleananySatisfy(CharPredicate predicate) voidappendString(Appendable appendable, String start, String separator, String end) intbinarySearch(char value) charcharAt(int index) chunk(int size) <V> ImmutableList<V>collect(CharToObjectFunction<? extends V> function) collectChar(CharToCharFunction function) booleancontains(char expected) intcount(CharPredicate predicate) chardetectIfNone(CharPredicate predicate, char ifNone) distinct()longdotProduct(CharList list) voideach(CharProcedure procedure) booleanvoidforEachWithIndex(CharIntProcedure procedure) static CharAdapterfrom(char... chars) static CharAdapterfrom(CharIterable iterable) charget(int index) getCharacter(int index) chargetFirst()chargetLast()inthashCode()intindexOf(char value) <T> TinjectInto(T injectedValue, ObjectCharToObjectFunction<? super T, ? extends T> function) <T> TinjectIntoWithIndex(T injectedValue, ObjectCharIntToObjectFunction<? super T, ? extends T> function) booleanisEmpty()intlastIndexOf(char value) intlength()charmax()charmin()newWith(char element) newWithAll(CharIterable elements) newWithout(char element) newWithoutAll(CharIterable elements) booleannoneSatisfy(CharPredicate predicate) reject(CharPredicate predicate) select(CharPredicate predicate) intsize()subList(int fromIndex, int toIndex) subSequence(int start, int end) longsum()char[]toArray()char[]toArray(char[] target) toBag()toList()toSet()toStack()toString()The value of toString must be strictly implemented as defined in CharSequence.<T> ImmutableList<CharObjectPair<T>>zipChar(CharIterable iterable) Methods inherited from class org.eclipse.collections.impl.primitive.AbstractCharIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toSortedArray, toSortedListMethods inherited from interface org.eclipse.collections.api.CharIterable
asLazy, average, averageIfEmpty, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, maxIfEmpty, median, medianIfEmpty, minIfEmpty, reduce, reduceIfEmpty, reject, select, summaryStatistics, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListByMethods inherited from interface org.eclipse.collections.api.list.primitive.CharList
forEachInBothMethods inherited from interface java.lang.CharSequence
chars, codePointsMethods inherited from interface org.eclipse.collections.api.list.primitive.ImmutableCharList
collectWithIndex, rejectWithIndex, selectWithIndex, tapMethods inherited from interface org.eclipse.collections.api.ordered.primitive.OrderedCharIterable
collectWithIndex, rejectWithIndex, selectWithIndexMethods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, makeString, makeString, makeString, notEmpty
-
Constructor Details
-
CharAdapter
-
-
Method Details
-
adapt
-
from
-
from
-
charAt
public char charAt(int index) - Specified by:
charAtin interfaceCharSequence
-
length
public int length()- Specified by:
lengthin interfaceCharSequence
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCharSequence- Specified by:
isEmptyin interfacePrimitiveIterable
-
subSequence
- Specified by:
subSequencein interfaceCharSequence
-
toStringBuilder
-
toString
The value of toString must be strictly implemented as defined in CharSequence.- Specified by:
toStringin interfaceCharSequence- Specified by:
toStringin interfacePrimitiveIterable- Overrides:
toStringin classAbstractCharIterable
-
charIterator
- Specified by:
charIteratorin interfaceCharIterable
-
toArray
public char[] toArray()- Specified by:
toArrayin interfaceCharIterable
-
toArray
public char[] toArray(char[] target) - Specified by:
toArrayin interfaceCharIterable
-
contains
public boolean contains(char expected) - Specified by:
containsin interfaceCharIterable
-
each
- Specified by:
eachin interfaceCharIterable
-
distinct
- Specified by:
distinctin interfaceCharList- Specified by:
distinctin interfaceImmutableCharList- Specified by:
distinctin interfaceReversibleCharIterable
-
newWith
- Specified by:
newWithin interfaceImmutableCharCollection- Specified by:
newWithin interfaceImmutableCharList
-
newWithout
- Specified by:
newWithoutin interfaceImmutableCharCollection- Specified by:
newWithoutin interfaceImmutableCharList
-
newWithAll
- Specified by:
newWithAllin interfaceImmutableCharCollection- Specified by:
newWithAllin interfaceImmutableCharList
-
newWithoutAll
- Specified by:
newWithoutAllin interfaceImmutableCharCollection- Specified by:
newWithoutAllin interfaceImmutableCharList
-
toReversed
- Specified by:
toReversedin interfaceCharList- Specified by:
toReversedin interfaceImmutableCharList- Specified by:
toReversedin interfaceReversibleCharIterable
-
subList
- Specified by:
subListin interfaceCharList- Specified by:
subListin interfaceImmutableCharList
-
get
public char get(int index) -
getCharacter
-
dotProduct
- Specified by:
dotProductin interfaceCharList
-
binarySearch
public int binarySearch(char value) - Specified by:
binarySearchin interfaceCharList
-
lastIndexOf
public int lastIndexOf(char value) - Specified by:
lastIndexOfin interfaceCharList
-
toImmutable
- Specified by:
toImmutablein interfaceCharList
-
getLast
public char getLast()- Specified by:
getLastin interfaceReversibleCharIterable
-
asReversed
- Specified by:
asReversedin interfaceReversibleCharIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectCharIntToObjectFunction<? super T, ? extends T> function) - Specified by:
injectIntoWithIndexin interfaceOrderedCharIterable- Specified by:
injectIntoWithIndexin interfaceReversibleCharIterable
-
getFirst
public char getFirst()- Specified by:
getFirstin interfaceOrderedCharIterable
-
indexOf
public int indexOf(char value) - Specified by:
indexOfin interfaceOrderedCharIterable
-
forEachWithIndex
- Specified by:
forEachWithIndexin interfaceOrderedCharIterable
-
select
- Specified by:
selectin interfaceCharIterable- Specified by:
selectin interfaceCharList- Specified by:
selectin interfaceImmutableCharCollection- Specified by:
selectin interfaceImmutableCharList- Specified by:
selectin interfaceOrderedCharIterable- Specified by:
selectin interfaceReversibleCharIterable
-
reject
- Specified by:
rejectin interfaceCharIterable- Specified by:
rejectin interfaceCharList- Specified by:
rejectin interfaceImmutableCharCollection- Specified by:
rejectin interfaceImmutableCharList- Specified by:
rejectin interfaceOrderedCharIterable- Specified by:
rejectin interfaceReversibleCharIterable
-
collect
- Specified by:
collectin interfaceCharIterable- Specified by:
collectin interfaceCharList- Specified by:
collectin interfaceImmutableCharCollection- Specified by:
collectin interfaceImmutableCharList- Specified by:
collectin interfaceOrderedCharIterable- Specified by:
collectin interfaceReversibleCharIterable
-
collectChar
-
detectIfNone
- Specified by:
detectIfNonein interfaceCharIterable
-
count
- Specified by:
countin interfaceCharIterable
-
anySatisfy
- Specified by:
anySatisfyin interfaceCharIterable
-
allSatisfy
- Specified by:
allSatisfyin interfaceCharIterable
-
noneSatisfy
- Specified by:
noneSatisfyin interfaceCharIterable
-
toList
- Specified by:
toListin interfaceCharIterable- Overrides:
toListin classAbstractCharIterable
-
toSet
- Specified by:
toSetin interfaceCharIterable- Overrides:
toSetin classAbstractCharIterable
-
toBag
- Specified by:
toBagin interfaceCharIterable- Overrides:
toBagin classAbstractCharIterable
-
injectInto
public <T> T injectInto(T injectedValue, ObjectCharToObjectFunction<? super T, ? extends T> function) - Specified by:
injectIntoin interfaceCharIterable
-
chunk
- Specified by:
chunkin interfaceCharIterable
-
sum
public long sum()- Specified by:
sumin interfaceCharIterable
-
max
public char max()- Specified by:
maxin interfaceCharIterable
-
min
public char min()- Specified by:
minin interfaceCharIterable
-
size
public int size()- Specified by:
sizein interfacePrimitiveIterable
-
appendString
- Specified by:
appendStringin interfacePrimitiveIterable
-
equals
-
hashCode
public int hashCode() -
zipChar
- Specified by:
zipCharin interfaceCharList- Specified by:
zipCharin interfaceImmutableCharList- Since:
- 9.1.
-
zip
- Specified by:
zipin interfaceCharList- Specified by:
zipin interfaceImmutableCharList- Since:
- 9.1.
-
toStack
- Specified by:
toStackin interfaceOrderedCharIterable
-