Class CodePointList
- java.lang.Object
-
- org.eclipse.collections.impl.primitive.AbstractIntIterable
-
- org.eclipse.collections.impl.string.immutable.CodePointList
-
- All Implemented Interfaces:
Serializable
,CharSequence
,ImmutableIntCollection
,IntIterable
,ImmutableIntList
,IntList
,OrderedIntIterable
,ReversibleIntIterable
,PrimitiveIterable
public class CodePointList extends AbstractIntIterable implements CharSequence, ImmutableIntList, Serializable
Calculates and provides the code points stored in a String as an ImmutableIntList. This is a cleaner more OO way of providing many of the iterable protocols available in StringIterate for code points.- Since:
- 7.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CodePointList(String value)
-
Method Summary
-
Methods inherited from class org.eclipse.collections.impl.primitive.AbstractIntIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toSortedArray, toSortedList
-
Methods inherited from interface java.lang.CharSequence
chars, codePoints
-
Methods inherited from interface org.eclipse.collections.api.list.primitive.ImmutableIntList
collectWithIndex, rejectWithIndex, selectWithIndex, tap
-
Methods inherited from interface org.eclipse.collections.api.IntIterable
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, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.list.primitive.IntList
forEachInBoth, primitiveParallelStream, primitiveStream
-
Methods inherited from interface org.eclipse.collections.api.ordered.primitive.OrderedIntIterable
collectWithIndex, rejectWithIndex, selectWithIndex
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, makeString, makeString, makeString, notEmpty
-
-
-
-
Constructor Detail
-
CodePointList
public CodePointList(String value)
-
-
Method Detail
-
from
public static CodePointList from(String value)
-
from
public static CodePointList from(int... codePoints)
-
from
public static CodePointList from(IntIterable iterable)
-
toStringBuilder
public StringBuilder toStringBuilder()
-
charAt
public char charAt(int index)
- Specified by:
charAt
in interfaceCharSequence
-
length
public int length()
- Specified by:
length
in interfaceCharSequence
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacePrimitiveIterable
-
subSequence
public String subSequence(int start, int end)
- Specified by:
subSequence
in interfaceCharSequence
-
toString
public String toString()
The value of toString must be strictly implemented as defined in CharSequence.- Specified by:
toString
in interfaceCharSequence
- Specified by:
toString
in interfacePrimitiveIterable
- Overrides:
toString
in classAbstractIntIterable
-
intIterator
public IntIterator intIterator()
- Specified by:
intIterator
in interfaceIntIterable
-
toArray
public int[] toArray()
- Specified by:
toArray
in interfaceIntIterable
-
toArray
public int[] toArray(int[] target)
- Specified by:
toArray
in interfaceIntIterable
-
contains
public boolean contains(int expected)
- Specified by:
contains
in interfaceIntIterable
-
each
public void each(IntProcedure procedure)
- Specified by:
each
in interfaceIntIterable
-
distinct
public CodePointList distinct()
- Specified by:
distinct
in interfaceImmutableIntList
- Specified by:
distinct
in interfaceIntList
- Specified by:
distinct
in interfaceReversibleIntIterable
-
newWith
public CodePointList newWith(int element)
- Specified by:
newWith
in interfaceImmutableIntCollection
- Specified by:
newWith
in interfaceImmutableIntList
-
newWithout
public CodePointList newWithout(int element)
- Specified by:
newWithout
in interfaceImmutableIntCollection
- Specified by:
newWithout
in interfaceImmutableIntList
-
newWithAll
public CodePointList newWithAll(IntIterable elements)
- Specified by:
newWithAll
in interfaceImmutableIntCollection
- Specified by:
newWithAll
in interfaceImmutableIntList
-
newWithoutAll
public CodePointList newWithoutAll(IntIterable elements)
- Specified by:
newWithoutAll
in interfaceImmutableIntCollection
- Specified by:
newWithoutAll
in interfaceImmutableIntList
-
toReversed
public CodePointList toReversed()
- Specified by:
toReversed
in interfaceImmutableIntList
- Specified by:
toReversed
in interfaceIntList
- Specified by:
toReversed
in interfaceReversibleIntIterable
-
subList
public ImmutableIntList subList(int fromIndex, int toIndex)
- Specified by:
subList
in interfaceImmutableIntList
- Specified by:
subList
in interfaceIntList
-
dotProduct
public long dotProduct(IntList list)
- Specified by:
dotProduct
in interfaceIntList
-
binarySearch
public int binarySearch(int value)
- Specified by:
binarySearch
in interfaceIntList
-
lastIndexOf
public int lastIndexOf(int value)
- Specified by:
lastIndexOf
in interfaceIntList
-
toImmutable
public ImmutableIntList toImmutable()
- Specified by:
toImmutable
in interfaceIntList
-
getLast
public int getLast()
- Specified by:
getLast
in interfaceReversibleIntIterable
-
asReversed
public LazyIntIterable asReversed()
- Specified by:
asReversed
in interfaceReversibleIntIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectIntIntToObjectFunction<? super T,? extends T> function)
- Specified by:
injectIntoWithIndex
in interfaceOrderedIntIterable
- Specified by:
injectIntoWithIndex
in interfaceReversibleIntIterable
-
getFirst
public int getFirst()
- Specified by:
getFirst
in interfaceOrderedIntIterable
-
indexOf
public int indexOf(int value)
- Specified by:
indexOf
in interfaceOrderedIntIterable
-
forEachWithIndex
public void forEachWithIndex(IntIntProcedure procedure)
- Specified by:
forEachWithIndex
in interfaceOrderedIntIterable
-
select
public CodePointList select(IntPredicate predicate)
- Specified by:
select
in interfaceImmutableIntCollection
- Specified by:
select
in interfaceImmutableIntList
- Specified by:
select
in interfaceIntIterable
- Specified by:
select
in interfaceIntList
- Specified by:
select
in interfaceOrderedIntIterable
- Specified by:
select
in interfaceReversibleIntIterable
-
reject
public CodePointList reject(IntPredicate predicate)
- Specified by:
reject
in interfaceImmutableIntCollection
- Specified by:
reject
in interfaceImmutableIntList
- Specified by:
reject
in interfaceIntIterable
- Specified by:
reject
in interfaceIntList
- Specified by:
reject
in interfaceOrderedIntIterable
- Specified by:
reject
in interfaceReversibleIntIterable
-
collect
public <V> ImmutableList<V> collect(IntToObjectFunction<? extends V> function)
- Specified by:
collect
in interfaceImmutableIntCollection
- Specified by:
collect
in interfaceImmutableIntList
- Specified by:
collect
in interfaceIntIterable
- Specified by:
collect
in interfaceIntList
- Specified by:
collect
in interfaceOrderedIntIterable
- Specified by:
collect
in interfaceReversibleIntIterable
-
collectInt
public CodePointList collectInt(IntToIntFunction function)
-
detectIfNone
public int detectIfNone(IntPredicate predicate, int ifNone)
- Specified by:
detectIfNone
in interfaceIntIterable
-
count
public int count(IntPredicate predicate)
- Specified by:
count
in interfaceIntIterable
-
anySatisfy
public boolean anySatisfy(IntPredicate predicate)
- Specified by:
anySatisfy
in interfaceIntIterable
-
allSatisfy
public boolean allSatisfy(IntPredicate predicate)
- Specified by:
allSatisfy
in interfaceIntIterable
-
noneSatisfy
public boolean noneSatisfy(IntPredicate predicate)
- Specified by:
noneSatisfy
in interfaceIntIterable
-
toList
public MutableIntList toList()
- Specified by:
toList
in interfaceIntIterable
- Overrides:
toList
in classAbstractIntIterable
-
toSet
public MutableIntSet toSet()
- Specified by:
toSet
in interfaceIntIterable
- Overrides:
toSet
in classAbstractIntIterable
-
toBag
public MutableIntBag toBag()
- Specified by:
toBag
in interfaceIntIterable
- Overrides:
toBag
in classAbstractIntIterable
-
injectInto
public <T> T injectInto(T injectedValue, ObjectIntToObjectFunction<? super T,? extends T> function)
- Specified by:
injectInto
in interfaceIntIterable
-
chunk
public RichIterable<IntIterable> chunk(int size)
- Specified by:
chunk
in interfaceIntIterable
-
sum
public long sum()
- Specified by:
sum
in interfaceIntIterable
-
max
public int max()
- Specified by:
max
in interfaceIntIterable
-
min
public int min()
- Specified by:
min
in interfaceIntIterable
-
size
public int size()
- Specified by:
size
in interfacePrimitiveIterable
-
appendString
public void appendString(Appendable appendable, String start, String separator, String end)
- Specified by:
appendString
in interfacePrimitiveIterable
-
equals
public boolean equals(Object otherList)
-
hashCode
public int hashCode()
-
zipInt
public ImmutableList<IntIntPair> zipInt(IntIterable iterable)
- Specified by:
zipInt
in interfaceImmutableIntList
- Specified by:
zipInt
in interfaceIntList
- Since:
- 9.1.
-
zip
public <T> ImmutableList<IntObjectPair<T>> zip(Iterable<T> iterable)
- Specified by:
zip
in interfaceImmutableIntList
- Specified by:
zip
in interfaceIntList
- Since:
- 9.1.
-
spliterator
public Spliterator.OfInt spliterator()
- Specified by:
spliterator
in interfaceIntList
-
-