Top Description Inners Fields Constructors Methods
org.eclipse.collections.impl.string.immutable

public Class CharAdapter

extends AbstractCharIterable
implements CharSequence, ImmutableCharList, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.eclipse.collections.api.list.primitive.ImmutableCharList, org.eclipse.collections.api.list.primitive.CharList, org.eclipse.collections.api.ordered.primitive.ReversibleCharIterable, org.eclipse.collections.api.ordered.primitive.OrderedCharIterable, org.eclipse.collections.api.CharIterable, org.eclipse.collections.api.PrimitiveIterable, org.eclipse.collections.api.collection.primitive.ImmutableCharCollection, java.lang.CharSequence
Imports
java.io.IOException, .Serializable, java.util.Iterator, .NoSuchElementException, org.eclipse.collections.api.CharIterable, .LazyCharIterable, .RichIterable, org.eclipse.collections.api.bag.primitive.MutableCharBag, org.eclipse.collections.api.block.function.primitive.CharToCharFunction, .CharToObjectFunction, .ObjectCharIntToObjectFunction, .ObjectCharToObjectFunction, org.eclipse.collections.api.block.predicate.primitive.CharPredicate, org.eclipse.collections.api.block.procedure.primitive.CharIntProcedure, .CharProcedure, org.eclipse.collections.api.factory.Lists, org.eclipse.collections.api.factory.primitive.CharBags, .CharLists, .CharSets, org.eclipse.collections.api.iterator.CharIterator, org.eclipse.collections.api.list.ImmutableList, .MutableList, org.eclipse.collections.api.list.primitive.CharList, .ImmutableCharList, .MutableCharList, org.eclipse.collections.api.set.primitive.MutableCharSet, org.eclipse.collections.api.stack.primitive.MutableCharStack, org.eclipse.collections.api.tuple.primitive.CharCharPair, .CharObjectPair, org.eclipse.collections.impl.factory.primitive.CharStacks, org.eclipse.collections.impl.lazy.primitive.ReverseCharIterable, org.eclipse.collections.impl.list.mutable.FastList, org.eclipse.collections.impl.primitive.AbstractCharIterable, org.eclipse.collections.impl.tuple.primitive.PrimitiveTuples, org.eclipse.collections.impl.utility.Iterate, .StringIterate

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private final String
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static CharAdapter
adapt(String value)

public boolean
allSatisfy(CharPredicate predicate)

Implements org.eclipse.collections.api.CharIterable.allSatisfy.

Returns true if all of the elements in the CharIterable return true for the specified predicate, otherwise returns false.

public boolean
anySatisfy(CharPredicate predicate)

Implements org.eclipse.collections.api.CharIterable.anySatisfy.

Returns true if any of the elements in the CharIterable return true for the specified predicate, otherwise returns false.

public void
appendString(Appendable appendable, String start, String separator, String end)

Implements org.eclipse.collections.api.PrimitiveIterable.appendString.

Prints a string representation of this collection onto the given Appendable.

public LazyCharIterable
public int
public char
charAt(int index)

Implements java.lang.CharSequence.charAt.

Returns the char value at the specified index.

public CharIterator
charIterator()

Implements org.eclipse.collections.api.CharIterable.charIterator.

Returns a primitive iterator that can be used to iterate over the CharIterable in an imperative style.

public RichIterable<CharIterable>
chunk(int size)

Overrides default org.eclipse.collections.api.CharIterable.chunk.

Partitions elements in fixed size chunks.

public <V> ImmutableList<V>
collect(CharToObjectFunction<? extends V> function)

Implements org.eclipse.collections.api.list.primitive.ImmutableCharList.collect, org.eclipse.collections.api.CharIterable.collect.

Returns a new collection with the results of applying the specified function on each element of the source collection.

public CharAdapter
public boolean
contains(char expected)

Implements org.eclipse.collections.api.CharIterable.contains.

Returns true if the value is contained in the CharIterable, and false if it is not.

public int
count(CharPredicate predicate)

Implements org.eclipse.collections.api.CharIterable.count.

Returns a count of the number of elements in the CharIterable that return true for the specified predicate.

public char
public CharAdapter
public long
public void
each(CharProcedure procedure)

Implements org.eclipse.collections.api.CharIterable.each.

A synonym for forEach.

public boolean
public void
public static CharAdapter
from(char... chars)

public static CharAdapter
from(CharIterable iterable)

public char
public Character
getCharacter(int index)

public char
public char
public int
public int
public <T> T
injectInto(T injectedValue, ObjectCharToObjectFunction<? super T, ? extends T> function)

Implements org.eclipse.collections.api.CharIterable.injectInto.

public <T> T
public boolean
isEmpty()

Overrides default java.lang.CharSequence.isEmpty, org.eclipse.collections.api.PrimitiveIterable.isEmpty.

Returns true if this character sequence is empty.

public int
public int
length()

Implements java.lang.CharSequence.length.

Returns the length of this character sequence.

public char
public char
public CharAdapter
public CharAdapter
public CharAdapter
public CharAdapter
public boolean
noneSatisfy(CharPredicate predicate)

Overrides default org.eclipse.collections.api.CharIterable.noneSatisfy.

Returns true if none of the elements in the CharIterable return true for the specified predicate, otherwise returns false.

public CharAdapter
reject(CharPredicate predicate)

Implements org.eclipse.collections.api.list.primitive.ImmutableCharList.reject, org.eclipse.collections.api.CharIterable.reject.

Returns a new CharIterable with all of the elements in the CharIterable that return false for the specified predicate.

public CharAdapter
select(CharPredicate predicate)

Implements org.eclipse.collections.api.list.primitive.ImmutableCharList.select, org.eclipse.collections.api.CharIterable.select.

Returns a new CharIterable with all of the elements in the CharIterable that return true for the specified predicate.

public int
size()

Implements org.eclipse.collections.api.PrimitiveIterable.size.

Returns the number of items in this iterable.

public ImmutableCharList
public String
subSequence(int start, int end)

Implements java.lang.CharSequence.subSequence.

Returns a CharSequence that is a subsequence of this sequence.

public long
public char[]
toArray()

Implements org.eclipse.collections.api.CharIterable.toArray.

Converts the CharIterable to a primitive char array.

public char[]
toArray(char[] target)

Overrides default org.eclipse.collections.api.CharIterable.toArray.

Converts the CharIterable to a primitive char array.

public MutableCharBag
toBag()

Overrides org.eclipse.collections.impl.primitive.AbstractCharIterable.toBag.

Implements org.eclipse.collections.api.CharIterable.toBag.

Converts the CharIterable to a new MutableCharBag.

public ImmutableCharList
toImmutable()

Implements org.eclipse.collections.api.list.primitive.CharList.toImmutable.

Returns an immutable copy of this list.

public MutableCharList
public CharAdapter
public MutableCharSet
toSet()

Overrides org.eclipse.collections.impl.primitive.AbstractCharIterable.toSet.

Implements org.eclipse.collections.api.CharIterable.toSet.

Converts the CharIterable to a new MutableCharSet.

public MutableCharStack
toStack()

Overrides default org.eclipse.collections.api.ordered.primitive.OrderedCharIterable.toStack.

Converts the collection to a CharStack.

public String
toString()

Overrides org.eclipse.collections.impl.primitive.AbstractCharIterable.toString.

Implements java.lang.CharSequence.toString, org.eclipse.collections.api.PrimitiveIterable.toString.

The value of toString must be strictly implemented as defined in CharSequence.

public StringBuilder
public <T> ImmutableList<CharObjectPair<T>>
zip(Iterable<T> iterable)

Overrides default org.eclipse.collections.api.list.primitive.ImmutableCharList.zip.

Returns an ImmutableList formed from this ImmutableCharList and a ListIterable by combining corresponding elements in pairs.

public ImmutableList<CharCharPair>
zipChar(CharIterable iterable)

Overrides default org.eclipse.collections.api.list.primitive.ImmutableCharList.zipChar.

Returns an ImmutableList formed from this ImmutableCharList and another CharList by combining corresponding elements in pairs.

Inherited from org.eclipse.collections.impl.primitive.AbstractCharIterable:
asLazyaveragemaxIfEmptymedianminIfEmptytoSortedArraytoSortedList

Field Detail

adaptedback to summary
private final String adapted
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

CharAdapterback to summary
public CharAdapter(String value)

Method Detail

adaptback to summary
public static CharAdapter adapt(String value)
allSatisfyback to summary
public boolean allSatisfy(CharPredicate predicate)

Implements org.eclipse.collections.api.CharIterable.allSatisfy.

Doc from org.eclipse.collections.api.CharIterable.allSatisfy.

Returns true if all of the elements in the CharIterable return true for the specified predicate, otherwise returns false.

Annotations
@Override
anySatisfyback to summary
public boolean anySatisfy(CharPredicate predicate)

Implements org.eclipse.collections.api.CharIterable.anySatisfy.

Doc from org.eclipse.collections.api.CharIterable.anySatisfy.

Returns true if any of the elements in the CharIterable return true for the specified predicate, otherwise returns false.

Annotations
@Override
appendStringback to summary
public void appendString(Appendable appendable, String start, String separator, String end)

Implements org.eclipse.collections.api.PrimitiveIterable.appendString.

Doc from org.eclipse.collections.api.PrimitiveIterable.appendString.

Prints a string representation of this collection onto the given Appendable. Prints the string returned by makeString(String, String, String).

Annotations
@Override
asReversedback to summary
public LazyCharIterable asReversed()

Implements org.eclipse.collections.api.ordered.primitive.ReversibleCharIterable.asReversed.

Annotations
@Override
binarySearchback to summary
public int binarySearch(char value)

Implements org.eclipse.collections.api.list.primitive.CharList.binarySearch.

Annotations
@Override
charAtback to summary
public char charAt(int index)

Implements java.lang.CharSequence.charAt.

Doc from java.lang.CharSequence.charAt.

Returns the char value at the specified index. An index ranges from zero to length() - 1. The first char value of the sequence is at index zero, the next at index one, and so on, as for array indexing.

If the char value specified by the index is a surrogate, the surrogate value is returned.

Annotations
@Override
charIteratorback to summary
public CharIterator charIterator()

Implements org.eclipse.collections.api.CharIterable.charIterator.

Doc from org.eclipse.collections.api.CharIterable.charIterator.

Returns a primitive iterator that can be used to iterate over the CharIterable in an imperative style.

Annotations
@Override
chunkback to summary
public RichIterable<CharIterable> chunk(int size)

Overrides default org.eclipse.collections.api.CharIterable.chunk.

Doc from org.eclipse.collections.api.CharIterable.chunk.

Partitions elements in fixed size chunks.

Annotations
@Override
collectback to summary
public <V> ImmutableList<V> collect(CharToObjectFunction<? extends V> function)

Implements org.eclipse.collections.api.list.primitive.ImmutableCharList.collect, org.eclipse.collections.api.CharIterable.collect.

Doc from org.eclipse.collections.api.CharIterable.collect.

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.

Annotations
@Override
collectCharback to summary
public CharAdapter collectChar(CharToCharFunction function)
containsback to summary
public boolean contains(char expected)

Implements org.eclipse.collections.api.CharIterable.contains.

Doc from org.eclipse.collections.api.CharIterable.contains.

Returns true if the value is contained in the CharIterable, and false if it is not.

Annotations
@Override
countback to summary
public int count(CharPredicate predicate)

Implements org.eclipse.collections.api.CharIterable.count.

Doc from org.eclipse.collections.api.CharIterable.count.

Returns a count of the number of elements in the CharIterable that return true for the specified predicate.

Annotations
@Override
detectIfNoneback to summary
public char detectIfNone(CharPredicate predicate, char ifNone)

Implements org.eclipse.collections.api.CharIterable.detectIfNone.

Annotations
@Override
distinctback to summary
public CharAdapter distinct()

Implements org.eclipse.collections.api.list.primitive.ImmutableCharList.distinct.

Annotations
@Override
dotProductback to summary
public long dotProduct(CharList list)

Implements org.eclipse.collections.api.list.primitive.CharList.dotProduct.

Annotations
@Override
eachback to summary
public void each(CharProcedure procedure)

Implements org.eclipse.collections.api.CharIterable.each.

Doc from org.eclipse.collections.api.CharIterable.each.

A synonym for forEach.

Annotations
@Override
equalsback to summary
public boolean equals(Object otherList)

Overrides java.lang.Object.equals.

Implements org.eclipse.collections.api.list.primitive.CharList.equals.

Doc from org.eclipse.collections.api.list.primitive.CharList.equals.

Follows the same general contract as java.util.List#equals(Object).

Annotations
@Override
forEachWithIndexback to summary
public void forEachWithIndex(CharIntProcedure procedure)

Implements org.eclipse.collections.api.ordered.primitive.OrderedCharIterable.forEachWithIndex.

Annotations
@Override
fromback to summary
public static CharAdapter from(char... chars)
fromback to summary
public static CharAdapter from(CharIterable iterable)
getback to summary
public char get(int index)

Implements org.eclipse.collections.api.list.primitive.CharList.get.

Annotations
@Override
getCharacterback to summary
public Character getCharacter(int index)
getFirstback to summary
public char getFirst()

Implements org.eclipse.collections.api.ordered.primitive.OrderedCharIterable.getFirst.

Annotations
@Override
getLastback to summary
public char getLast()

Implements org.eclipse.collections.api.ordered.primitive.ReversibleCharIterable.getLast.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements org.eclipse.collections.api.list.primitive.CharList.hashCode.

Doc from org.eclipse.collections.api.list.primitive.CharList.hashCode.

Follows the same general contract as java.util.List#hashCode().

Annotations
@Override
indexOfback to summary
public int indexOf(char value)

Implements org.eclipse.collections.api.ordered.primitive.OrderedCharIterable.indexOf.

Annotations
@Override
injectIntoback to summary
public <T> T injectInto(T injectedValue, ObjectCharToObjectFunction<? super T, ? extends T> function)

Implements org.eclipse.collections.api.CharIterable.injectInto.

Annotations
@Override
injectIntoWithIndexback to summary
public <T> T injectIntoWithIndex(T injectedValue, ObjectCharIntToObjectFunction<? super T, ? extends T> function)

Implements org.eclipse.collections.api.ordered.primitive.ReversibleCharIterable.injectIntoWithIndex.

Annotations
@Override
isEmptyback to summary
public boolean isEmpty()

Overrides default java.lang.CharSequence.isEmpty, org.eclipse.collections.api.PrimitiveIterable.isEmpty.

Doc from java.lang.CharSequence.isEmpty.

Returns true if this character sequence is empty.

Annotations
@Override
lastIndexOfback to summary
public int lastIndexOf(char value)

Implements org.eclipse.collections.api.list.primitive.CharList.lastIndexOf.

Annotations
@Override
lengthback to summary
public int length()

Implements java.lang.CharSequence.length.

Doc from java.lang.CharSequence.length.

Returns the length of this character sequence. The length is the number of 16-bit chars in the sequence.

Annotations
@Override
maxback to summary
public char max()

Implements org.eclipse.collections.api.CharIterable.max.

Annotations
@Override
minback to summary
public char min()

Implements org.eclipse.collections.api.CharIterable.min.

Annotations
@Override
newWithback to summary
public CharAdapter newWith(char element)

Implements org.eclipse.collections.api.list.primitive.ImmutableCharList.newWith.

Annotations
@Override
newWithAllback to summary
public CharAdapter newWithAll(CharIterable elements)

Implements org.eclipse.collections.api.list.primitive.ImmutableCharList.newWithAll.

Annotations
@Override
newWithoutback to summary
public CharAdapter newWithout(char element)

Implements org.eclipse.collections.api.list.primitive.ImmutableCharList.newWithout.

Annotations
@Override
newWithoutAllback to summary
public CharAdapter newWithoutAll(CharIterable elements)

Implements org.eclipse.collections.api.list.primitive.ImmutableCharList.newWithoutAll.

Annotations
@Override
noneSatisfyback to summary
public boolean noneSatisfy(CharPredicate predicate)

Overrides default org.eclipse.collections.api.CharIterable.noneSatisfy.

Doc from org.eclipse.collections.api.CharIterable.noneSatisfy.

Returns true if none of the elements in the CharIterable return true for the specified predicate, otherwise returns false.

Annotations
@Override
rejectback to summary
public CharAdapter reject(CharPredicate predicate)

Implements org.eclipse.collections.api.list.primitive.ImmutableCharList.reject, org.eclipse.collections.api.CharIterable.reject.

Doc from org.eclipse.collections.api.CharIterable.reject.

Returns a new CharIterable with all of the elements in the CharIterable that return false for the specified predicate.

Annotations
@Override
selectback to summary
public CharAdapter select(CharPredicate predicate)

Implements org.eclipse.collections.api.list.primitive.ImmutableCharList.select, org.eclipse.collections.api.CharIterable.select.

Doc from org.eclipse.collections.api.CharIterable.select.

Returns a new CharIterable with all of the elements in the CharIterable that return true for the specified predicate.

Annotations
@Override
sizeback to summary
public int size()

Implements org.eclipse.collections.api.PrimitiveIterable.size.

Doc from org.eclipse.collections.api.PrimitiveIterable.size.

Returns the number of items in this iterable.

Annotations
@Override
subListback to summary
public ImmutableCharList subList(int fromIndex, int toIndex)

Implements org.eclipse.collections.api.list.primitive.ImmutableCharList.subList.

Annotations
@Override
subSequenceback to summary
public String subSequence(int start, int end)

Implements java.lang.CharSequence.subSequence.

Doc from java.lang.CharSequence.subSequence.

Returns a CharSequence that is a subsequence of this sequence. The subsequence starts with the char value at the specified index and ends with the char value at index end - 1. The length (in chars) of the returned sequence is end - start, so if start == end then an empty sequence is returned.

Annotations
@Override
sumback to summary
public long sum()

Implements org.eclipse.collections.api.CharIterable.sum.

Annotations
@Override
toArrayback to summary
public char[] toArray()

Implements org.eclipse.collections.api.CharIterable.toArray.

Doc from org.eclipse.collections.api.CharIterable.toArray.

Converts the CharIterable to a primitive char array.

Annotations
@Override
toArrayback to summary
public char[] toArray(char[] target)

Overrides default org.eclipse.collections.api.CharIterable.toArray.

Doc from org.eclipse.collections.api.CharIterable.toArray.

Converts the CharIterable to a primitive char array. If the collection fits into the provided array it is used to store its elements and is returned from the method, otherwise a new array of the appropriate size is allocated and returned. If the iterable is empty, the target array is returned unchanged.

Annotations
@Override
toBagback to summary
public MutableCharBag toBag()

Overrides org.eclipse.collections.impl.primitive.AbstractCharIterable.toBag.

Implements org.eclipse.collections.api.CharIterable.toBag.

Doc from org.eclipse.collections.api.CharIterable.toBag.

Converts the CharIterable to a new MutableCharBag.

Annotations
@Override
toImmutableback to summary
public ImmutableCharList toImmutable()

Implements org.eclipse.collections.api.list.primitive.CharList.toImmutable.

Doc from org.eclipse.collections.api.list.primitive.CharList.toImmutable.

Returns an immutable copy of this list. If the list is immutable, it returns itself.

Annotations
@Override
toListback to summary
public MutableCharList toList()

Overrides org.eclipse.collections.impl.primitive.AbstractCharIterable.toList.

Implements org.eclipse.collections.api.CharIterable.toList.

Doc from org.eclipse.collections.api.CharIterable.toList.

Converts the CharIterable to a new MutableCharList.

Annotations
@Override
toReversedback to summary
public CharAdapter toReversed()

Implements org.eclipse.collections.api.list.primitive.ImmutableCharList.toReversed.

Annotations
@Override
toSetback to summary
public MutableCharSet toSet()

Overrides org.eclipse.collections.impl.primitive.AbstractCharIterable.toSet.

Implements org.eclipse.collections.api.CharIterable.toSet.

Doc from org.eclipse.collections.api.CharIterable.toSet.

Converts the CharIterable to a new MutableCharSet.

Annotations
@Override
toStackback to summary
public MutableCharStack toStack()

Overrides default org.eclipse.collections.api.ordered.primitive.OrderedCharIterable.toStack.

Doc from org.eclipse.collections.api.ordered.primitive.OrderedCharIterable.toStack.

Converts the collection to a CharStack.

Annotations
@Override
toStringback to summary
public String toString()

Overrides org.eclipse.collections.impl.primitive.AbstractCharIterable.toString.

Implements java.lang.CharSequence.toString, org.eclipse.collections.api.PrimitiveIterable.toString.

The value of toString must be strictly implemented as defined in CharSequence.

Annotations
@Override
toStringBuilderback to summary
public StringBuilder toStringBuilder()
zipback to summary
public <T> ImmutableList<CharObjectPair<T>> zip(Iterable<T> iterable)

Overrides default org.eclipse.collections.api.list.primitive.ImmutableCharList.zip.

Doc from org.eclipse.collections.api.list.primitive.ImmutableCharList.zip.

Returns an 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.

Annotations
@Override
Since
9.1.
zipCharback to summary
public ImmutableList<CharCharPair> zipChar(CharIterable iterable)

Overrides default org.eclipse.collections.api.list.primitive.ImmutableCharList.zipChar.

Doc from org.eclipse.collections.api.list.primitive.ImmutableCharList.zipChar.

Returns an ImmutableList 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.

Annotations
@Override
Since
9.1.
org.eclipse.collections.impl.string.immutable back to summary

private Class CharAdapter.InternalCharIterator

extends Object
implements CharIterator
Class Inheritance
  • java.lang.Object
  • org.eclipse.collections.impl.string.immutable.CharAdapter.InternalCharIterator
All Implemented Interfaces
org.eclipse.collections.api.iterator.CharIterator

Field Summary

Modifier and TypeField and Description
private int
currentIndex

Index of element to be returned by subsequent call to next.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean
public char
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentIndexback to summary
private int currentIndex

Index of element to be returned by subsequent call to next.

Constructor Detail

InternalCharIteratorback to summary
private InternalCharIterator()

Method Detail

hasNextback to summary
public boolean hasNext()

Implements org.eclipse.collections.api.iterator.CharIterator.hasNext.

Annotations
@Override
nextback to summary
public char next()

Implements org.eclipse.collections.api.iterator.CharIterator.next.

Annotations
@Override