Top Description Inners Fields Constructors Methods
io.vavr.collection

public final Class CharSeq

Additional top-level class in compilation unit: CharSeqModule.

extends Object
implements CharSequence, IndexedSeq<Character>, Serializable, Comparable<CharSeq>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable, java.io.Serializable, io.vavr.collection.IndexedSeq, io.vavr.collection.Seq, io.vavr.PartialFunction, io.vavr.Function1, java.util.function.Function, io.vavr.collection.Traversable, io.vavr.Value, java.lang.Iterable, io.vavr.collection.Foldable, java.lang.CharSequence
Imports
io.vavr.*, io.vavr.collection.CharSeqModule.Combinations, .JavaConverters.ListView, io.vavr.control.Option, java.io.Serializable, .UnsupportedEncodingException, java.nio.charset.Charset, java.util.*, java.util.function.*, java.util.regex.Pattern, .PatternSyntaxException, java.util.stream.Collector

The CharSeq (read: character sequence) collection essentially is a rich String wrapper having all operations we know from the functional Vavr collections.

Note

Because CharSeq represents a sequence of primitive characters (i.e. a String), it breaks the Liskov Substitution Principle in the way, that the CharSeq cannot contain null elements. In future version of Java, CharSeq should extend IndexedSeq<char> instead.

Author
Ruslan Sennov, Daniel Dietrich

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
public static interface

Field Summary

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

Constructor Summary

AccessConstructor and Description
private
CharSeq(String javaString)

Method Summary

Modifier and TypeMethod and Description
public CharSeq
append(Character
An element
element
)

Implements io.vavr.collection.IndexedSeq.append.

Appends an element to this.

public CharSeq
appendAll(Iterable<? extends Character>
An Iterable of elements
elements
)

Implements io.vavr.collection.IndexedSeq.appendAll.

Appends all given elements to this.

public List<Character>
asJava()

Implements io.vavr.collection.Seq.asJava.

Creates an immutable java.util.List view on top of this Seq, i.e. calling mutators will result in UnsupportedOperationException at runtime.

public CharSeq
asJava(Consumer<? super List<Character>>
A side-effecting unit of work that operates on an immutable java.util.List view.
action
)

Implements io.vavr.collection.IndexedSeq.asJava.

Creates an immutable java.util.List view on top of this Seq that is passed to the given action.

public List<Character>
asJavaMutable()

Implements io.vavr.collection.Seq.asJavaMutable.

Creates a mutable java.util.List view on top of this Seq, i.e. all mutator methods of the java.util.List are implemented.

public CharSeq
asJavaMutable(Consumer<? super List<Character>>
A side-effecting unit of work that operates on a mutable java.util.List view.
action
)

Implements io.vavr.collection.IndexedSeq.asJavaMutable.

Creates a mutable java.util.List view on top of this Seq that is passed to the given action.

public CharSeq

Returns:

the CharSeq, capitalized.
capitalize
(Locale
use the case transformation rules for this locale
locale
)

Converts the first character in this CharSeq to upper case using the rules of the given Locale.

public CharSeq

Returns:

the CharSeq, capitalized.
capitalize
()

Converts the first character in this CharSeq to upper case using the rules of the default locale.

public char

Returns:

the char value at the specified index of this string. The first char value is at index 0.
charAt
(int
the index of the char value.
index
)

Implements java.lang.CharSequence.charAt.

Returns the char value at the specified index.

public int

Returns:

the code point value of the character at the index
codePointAt
(int
the index to the char values
index
)

Returns the character (Unicode code point) at the specified index.

public int

Returns:

the Unicode code point value before the given index.
codePointBefore
(int
the index following the code point that should be returned
index
)

Returns the character (Unicode code point) before the specified index.

public int

Returns:

the number of Unicode code points in the specified text range
codePointCount
(int
the index to the first char of the text range.
beginIndex
,
int
the index after the last char of the text range.
endIndex
)

Returns the number of Unicode code points in the specified text range of this CharSeq.

public <R> IndexedSeq<R>
collect(PartialFunction<? super Character, ? extends R>
A function that is not necessarily defined of all elements of this traversable.
partialFunction
)

Implements io.vavr.collection.IndexedSeq.collect.

Collects all elements that are in the domain of the given partialFunction by mapping the elements to type R.

public static Collector<Character, ArrayList<Character>, CharSeq>

Returns:

A CharSeq Collector.
collector
()

Returns a java.util.stream.Collector which may be used in conjunction with java.util.stream.Stream#collect(java.util.stream.Collector) to obtain a CharSeq.

public IndexedSeq<CharSeq>
combinations()

Implements io.vavr.collection.IndexedSeq.combinations.

Returns the union of all combinations from k = 0 to length().

public IndexedSeq<CharSeq>
combinations(int
Size of subsets
k
)

Implements io.vavr.collection.IndexedSeq.combinations.

Returns the k-combination of this traversable, i.e. all subset of this of k distinct elements.

public int

Returns:

the value 0 if the argument string is equal to this string; a value less than 0 if this string is lexicographically less than the string argument; and a value greater than 0 if this string is lexicographically greater than the string argument.
compareTo
(CharSeq
the CharSeq to be compared.
anotherString
)

Implements java.lang.Comparable.compareTo.

Compares two strings lexicographically.

public int

Returns:

a negative integer, zero, or a positive integer as the specified String is greater than, equal to, or less than this String, ignoring case considerations.
compareToIgnoreCase
(CharSeq
the CharSeq to be compared.
str
)

Compares two strings lexicographically, ignoring case differences.

public CharSeq

Returns:

a string that represents the concatenation of this object's characters followed by the string argument's characters.
concat
(CharSeq
the CharSeq that is concatenated to the end of this CharSeq.
str
)

Concatenates the specified string to the end of this string.

public boolean

Returns:

true if this string contains s, false otherwise
contains
(CharSequence
the sequence to search for
s
)

Overrides default io.vavr.Value.contains.

Returns true if and only if this string contains the specified sequence of char values.

public boolean

Returns:

true if this CharSeq represents the same sequence of characters as the specified StringBuffer, false otherwise
contentEquals
(StringBuffer
The StringBuffer to compare this CharSeq against
sb
)

Compares this string to the specified StringBuffer.

public boolean

Returns:

true if this CharSeq represents the same sequence of char values as the specified sequence, false otherwise
contentEquals
(CharSequence
The sequence to compare this CharSeq against
cs
)

Compares this string to the specified CharSequence.

public Iterator<CharSeq>
crossProduct(int
the number of cartesian multiplications
power
)

Implements io.vavr.collection.IndexedSeq.crossProduct.

Calculates the n-ary cartesian power (or cross product or simply product) of this.

public Byte

Returns:

a Byte object holding the byte value represented by this CharSeq
decodeByte
()

Decodes this CharSeq into a Byte by calling Byte#decode(String).

public Integer

Returns:

an Integer object holding the int value represented by this CharSeq
decodeInteger
()

Decodes this CharSeq into an Integer by calling Integer#decode(String).

public Long

Returns:

a Long object holding the long value represented by this CharSeq
decodeLong
()

Decodes this CharSeq into a Long by calling Long#decode(String).

public Short

Returns:

a Short object holding the short value represented by this CharSeq
decodeShort
()

Decodes this CharSeq into a Short by calling Short#decode(String).

public CharSeq
distinct()

Implements io.vavr.collection.IndexedSeq.distinct.

Returns a new version of this which contains no duplicates.

public CharSeq
distinctBy(Comparator<? super Character>
A comparator
comparator
)

Implements io.vavr.collection.IndexedSeq.distinctBy.

Returns a new version of this which contains no duplicates.

public <U> CharSeq
distinctBy(Function<? super Character, ? extends U>
A key extractor
keyExtractor
)

Implements io.vavr.collection.IndexedSeq.distinctBy.

Returns a new version of this which contains no duplicates.

public CharSeq
drop(int
The number of elements to drop.
n
)

Implements io.vavr.collection.IndexedSeq.drop.

Drops the first n elements of this or all elements, if this length < n.

public CharSeq
dropRight(int
The number of elements to drop.
n
)

Implements io.vavr.collection.IndexedSeq.dropRight.

Drops the last n elements of this or all elements, if this length < n.

public CharSeq
dropRightUntil(Predicate<? super Character>
A condition tested subsequently for this elements, starting from the end.
predicate
)

Implements io.vavr.collection.IndexedSeq.dropRightUntil.

Drops elements until the predicate holds for the current element, starting from the end.

public CharSeq
dropRightWhile(Predicate<? super Character>
A condition tested subsequently for this elements, starting from the end.
predicate
)

Implements io.vavr.collection.IndexedSeq.dropRightWhile.

Drops elements while the predicate holds for the current element, starting from the end.

public CharSeq
dropUntil(Predicate<? super Character>
A condition tested subsequently for this elements.
predicate
)

Implements io.vavr.collection.IndexedSeq.dropUntil.

Drops elements until the predicate holds for the current element.

public CharSeq
dropWhile(Predicate<? super Character>
A condition tested subsequently for this elements.
predicate
)

Implements io.vavr.collection.IndexedSeq.dropWhile.

Drops elements while the predicate holds for the current element.

public static CharSeq
public boolean

Returns:

true if the character sequence represented by the argument is a suffix of the character sequence represented by this object; false otherwise. Note that the result will be true if the argument is the empty string or is equal to this CharSeq object as determined by the equals(Object) method.
endsWith
(CharSeq
the suffix.
suffix
)

Tests if this string ends with the specified suffix.

public boolean
equals(Object
an object, may be null
o
)

Overrides java.lang.Object.equals.

Implements io.vavr.collection.Traversable.equals.

In Vavr there are four basic classes of collections:

  • Seq (sequential elements)
  • Set (distinct elements)
  • Map (indexed elements)
  • Multimap (indexed collections)
public boolean

Returns:

true if the argument is not null and it represents an equivalent CharSeq ignoring case; false otherwise
equalsIgnoreCase
(CharSeq
The CharSeq to compare this CharSeq against
anotherString
)

Compares this CharSeq to another CharSeq, ignoring case considerations.

public static CharSeq

Returns:

A CharSeq of size n, where each element contains the result supplied by s.
fill
(int
The number of elements in the CharSeq
n
,
Supplier<? extends Character>
The Supplier computing element values
s
)

Returns a CharSeq containing n values supplied by a given Supplier s.

public CharSeq
filter(Predicate<? super Character>
A predicate
predicate
)

Implements io.vavr.collection.IndexedSeq.filter.

Returns a new traversable consisting of all elements which satisfy the given predicate.

public <U> IndexedSeq<U>
flatMap(Function<? super Character, ? extends Iterable<? extends U>>
A mapper
mapper
)

Implements io.vavr.collection.IndexedSeq.flatMap.

FlatMaps this Traversable.

public CharSeq
public Character
get(int
an index
index
)

Implements io.vavr.collection.Seq.get.

Returns the element at the specified index.

public byte[]

Returns:

The resultant byte array
getBytes
(String
The name of a supported charset
charsetName
)

Encodes this CharSeq into a sequence of bytes using the named charset, storing the result into a new byte array.

public byte[]

Returns:

The resultant byte array
getBytes
(Charset
The java.nio.charset.Charset to be used to encode the CharSeq
charset
)

Encodes this CharSeq into a sequence of bytes using the given charset, storing the result into a new byte array.

public byte[]

Returns:

The resultant byte array
getBytes
()

Encodes this CharSeq into a sequence of bytes using the platform's default charset, storing the result into a new byte array.

public void
getChars(int
index of the first character in the string to copy.
srcBegin
,
int
index after the last character in the string to copy.
srcEnd
,
char[]
the destination array.
dst
,
int
the start offset in the destination array.
dstBegin
)

Copies characters from this string into the destination character array.

public <C> Map<C, CharSeq>
groupBy(Function<? super Character, ? extends C>
A function which classifies elements into classes
classifier
)

Implements io.vavr.collection.IndexedSeq.groupBy.

Groups this elements by classifying the elements.

public Iterator<CharSeq>
grouped(int
a positive block size
size
)

Implements io.vavr.collection.IndexedSeq.grouped.

Groups this Traversable into fixed size blocks.

public boolean
hasDefiniteSize()

Implements io.vavr.collection.Traversable.hasDefiniteSize.

Checks if this Traversable is known to have a finite size.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements io.vavr.collection.Traversable.hashCode.

Returns the hash code of this collection.

public Character
head()

Implements io.vavr.collection.Traversable.head.

Returns the first element of a non-empty Traversable.

public int
indexOf(Character
an element
element
,
int
start index
from
)

Implements io.vavr.collection.Seq.indexOf.

Returns the index of the first occurrence of the given element after or at some start index or -1 if this does not contain the given element.

public int

Returns:

the index of the first occurrence of the character in the character sequence represented by this object, or -1 if the character does not occur.
indexOf
(int
a character (Unicode code point).
ch
)

Overrides default io.vavr.collection.Seq.indexOf.

Returns the index within this string of the first occurrence of the specified character.

public int

Returns:

the index of the first occurrence of the character in the character sequence represented by this object that is greater than or equal to fromIndex, or -1 if the character does not occur.
indexOf
(int
a character (Unicode code point).
ch
,
int
the index to start the search from.
fromIndex
)

Implements io.vavr.collection.Seq.indexOf.

Returns the index within this string of the first occurrence of the specified character, starting the search at the specified index.

public int

Returns:

the index of the first occurrence of the specified substring, or -1 if there is no such occurrence.
indexOf
(CharSeq
the substring to search for.
str
)

Overrides default io.vavr.collection.Seq.indexOf.

Returns the index within this string of the first occurrence of the specified substring.

public int

Returns:

the index of the first occurrence of the specified substring, starting at the specified index, or -1 if there is no such occurrence.
indexOf
(CharSeq
the substring to search for.
str
,
int
the index from which to start the search.
fromIndex
)

Implements io.vavr.collection.Seq.indexOf.

Returns the index within this string of the first occurrence of the specified substring, starting at the specified index.

pack-priv Option<Integer>

Returns:

Some(index) or None if not found.
indexOfOption
(int
a character (Unicode code point).
ch
)

Overrides default io.vavr.collection.Seq.indexOfOption.

Returns the index of the first occurrence of the given element as an Option.

pack-priv Option<Integer>

Returns:

Some(index) or None if not found.
indexOfOption
(int
a character (Unicode code point).
ch
,
int
the index to start the search from.
fromIndex
)

Overrides default io.vavr.collection.Seq.indexOfOption.

Returns the index of the first occurrence of the given element as an Option, starting the search at the specified index.

public Option<Integer>

Returns:

Some(index) or None if not found.
indexOfOption
(CharSeq
the substring to search for.
str
)

Overrides default io.vavr.collection.Seq.indexOfOption.

Returns the index of the first occurrence of the given element as an Option.

public Option<Integer>

Returns:

Some(index) or None if not found.
indexOfOption
(CharSeq
the substring to search for.
str
,
int
the index from which to start the search.
fromIndex
)

Overrides default io.vavr.collection.Seq.indexOfOption.

Returns the index of the first occurrence of the given element as an Option, starting the search at the specified index.

public CharSeq
init()

Implements io.vavr.collection.IndexedSeq.init.

Dual of tail(), returning all elements except the last.

public Option<CharSeq>
initOption()

Implements io.vavr.collection.IndexedSeq.initOption.

Dual of tailOption(), returning all elements except the last as Option.

public CharSeq
insert(int
an index
index
,
Character
an element
element
)

Implements io.vavr.collection.IndexedSeq.insert.

Inserts the given element at the specified index.

public CharSeq
insertAll(int
an index
index
,
Iterable<? extends Character>
An Iterable of elements
elements
)

Implements io.vavr.collection.IndexedSeq.insertAll.

Inserts the given elements at the specified index.

public CharSeq
intersperse(Character
An element.
element
)

Implements io.vavr.collection.IndexedSeq.intersperse.

Inserts an element between all elements of this Traversable.

public boolean

Returns:

false
isAsync
()

Implements io.vavr.Value.isAsync.

A CharSeq is computed synchronously.

public boolean
isEmpty()

Overrides default java.lang.CharSequence.isEmpty, io.vavr.collection.Traversable.isEmpty.

Returns true if this character sequence is empty.

public boolean

Returns:

false
isLazy
()

Implements io.vavr.Value.isLazy.

A CharSeq is computed eagerly.

public boolean
isTraversableAgain()

Implements io.vavr.collection.Traversable.isTraversableAgain.

Checks if this Traversable can be repeatedly traversed.

public Iterator<Character>
iterator()

Overrides default io.vavr.collection.Traversable.iterator.

An iterator by means of head() and tail().

public int
lastIndexOf(Character
an element
element
,
int
the end index
end
)

Implements io.vavr.collection.Seq.lastIndexOf.

Returns the index of the last occurrence of the given element before or at a given end index or -1 if this does not contain the given element.

public int

Returns:

the index of the last occurrence of the character in the character sequence represented by this object, or -1 if the character does not occur.
lastIndexOf
(int
a character (Unicode code point).
ch
)

Overrides default io.vavr.collection.Seq.lastIndexOf.

Returns the index within this string of the last occurrence of the specified character.

public int

Returns:

the index of the last occurrence of the character in the character sequence represented by this object that is less than or equal to fromIndex, or -1 if the character does not occur before that point.
lastIndexOf
(int
a character (Unicode code point).
ch
,
int
the index to start the search from. There is no restriction on the value of fromIndex. If it is greater than or equal to the length of this string, it has the same effect as if it were equal to one less than the length of this string: this entire string may be searched. If it is negative, it has the same effect as if it were -1: -1 is returned.
fromIndex
)

Implements io.vavr.collection.Seq.lastIndexOf.

Returns the index within this string of the last occurrence of the specified character, searching backward starting at the specified index.

public int

Returns:

the index of the last occurrence of the specified substring, or -1 if there is no such occurrence.
lastIndexOf
(CharSeq
the substring to search for.
str
)

Overrides default io.vavr.collection.Seq.lastIndexOf.

Returns the index within this string of the last occurrence of the specified substring.

public int

Returns:

the index of the last occurrence of the specified substring, searching backward from the specified index, or -1 if there is no such occurrence.
lastIndexOf
(CharSeq
the substring to search for.
str
,
int
the index to start the search from.
fromIndex
)

Implements io.vavr.collection.Seq.lastIndexOf.

Returns the index within this string of the last occurrence of the specified substring, searching backward starting at the specified index.

pack-priv Option<Integer>

Returns:

Some(index) or None if not found.
lastIndexOfOption
(int
a character (Unicode code point).
ch
)

Overrides default io.vavr.collection.Seq.lastIndexOfOption.

Returns the index of the last occurrence of the given element as an Option.

public Option<Integer>

Returns:

Some(index) or None if not found.
lastIndexOfOption
(int
a character (Unicode code point).
ch
,
int
the index to start the search from.
fromIndex
)

Overrides default io.vavr.collection.Seq.lastIndexOfOption.

Returns the index of the last occurrence of the given element as an Option, starting the search at the specified index.

public Option<Integer>

Returns:

Some(index) or None if not found.
lastIndexOfOption
(CharSeq
the substring to search for.
str
)

Overrides default io.vavr.collection.Seq.lastIndexOfOption.

Returns the index of the last occurrence of the given element as an Option.

public Option<Integer>

Returns:

Some(index) or None if not found.
lastIndexOfOption
(CharSeq
the substring to search for.
str
,
int
the index to start the search from.
fromIndex
)

Overrides default io.vavr.collection.Seq.lastIndexOfOption.

Returns the index of the last occurrence of the given element as an Option, starting the search at the specified index.

public CharSeq
leftPadTo(int
the target length
length
,
Character
the padding element
element
)

Implements io.vavr.collection.Seq.leftPadTo.

A copy of this sequence with an element prepended until a given target length is reached.

public int

Returns:

the length of the sequence of characters represented by this object.
length
()

Implements java.lang.CharSequence.length, io.vavr.collection.Traversable.length.

Returns the length of this string.

public <U> IndexedSeq<U>
map(Function<? super Character, ? extends U>
A mapper.
mapper
)

Implements io.vavr.collection.IndexedSeq.map.

Maps the elements of this Traversable to elements of a new type preserving their order, if any.

public CharSeq
public boolean

Returns:

true if, and only if, this string matches the given regular expression
matches
(String
the regular expression to which this string is to be matched
regex
)

Tells whether or not this string matches the given regular expression.

public String
mkString()

Overrides default io.vavr.collection.Traversable.mkString.

Joins the elements of this by concatenating their string representations.

public static CharSeq
of(CharSequence
CharSequence instance.
sequence
)

Creates a String of CharSequence.

public static CharSeq

Returns:

A new CharSeq instance containing the given element
of
(char
A character.
character
)

Returns a singleton CharSeq, i.e. a CharSeq of one character.

public static CharSeq

Returns:

A string containing the given characters in the same order.
of
(char...
Zero or more characters.
characters
)

Creates a String of the given characters.

public static CharSeq

Returns:

A string containing the given elements in the same order.
ofAll
(Iterable<? extends Character>
An Iterable of elements.
elements
)

Creates a String of the given elements.

public int

Returns:

the index within this CharSeq
offsetByCodePoints
(int
the index to be offset
index
,
int
the offset in code points
codePointOffset
)

Returns the index within this CharSeq that is offset from the given index by codePointOffset code points.

public CharSeq
orElse(Iterable<? extends Character>
An alternative Traversable
other
)

Implements io.vavr.collection.IndexedSeq.orElse.

Returns this Traversable if it is nonempty, otherwise return the alternative.

public CharSeq
orElse(Supplier<? extends Iterable<? extends Character>>
An alternative Traversable supplier
supplier
)

Implements io.vavr.collection.IndexedSeq.orElse.

Returns this Traversable if it is nonempty, otherwise return the result of evaluating supplier.

private static StringBuilder
padding(char element, int limit)

public CharSeq
padTo(int
the target length
length
,
Character
the padding element
element
)

Implements io.vavr.collection.IndexedSeq.padTo.

A copy of this sequence with an element appended until a given target length is reached.

public boolean

Returns:

the boolean represented by this CharSeq
parseBoolean
()

Parses this CharSeq as a boolean by calling Boolean#parseBoolean(String).

public byte

Returns:

the byte value represented by this CharSeq in decimal
parseByte
()

Parses this CharSeq as a signed decimal byte by calling Byte#parseByte(String).

public byte

Returns:

the byte value represented by this CharSeq in the specified radix
parseByte
(int
the radix to be used in interpreting this CharSeq
radix
)

Parses this CharSeq as a signed byte in the specified radix by calling Byte#parseByte(String, int).

public double

Returns:

the double value represented by this CharSeq
parseDouble
()

Parses this CharSeq as a double by calling Double#parseDouble(String).

public float

Returns:

the float value represented by this CharSeq
parseFloat
()

Parses this CharSeq as a float by calling Float#parseFloat(String).

public int

Returns:

the int value represented by this CharSeq in decimal
parseInt
()

Parses this CharSeq as a signed decimal int by calling Integer#parseInt(String).

public int

Returns:

the int value represented by this CharSeq in the specified radix
parseInt
(int
the radix to be used in interpreting this CharSeq
radix
)

Parses this CharSeq as a signed int in the specified radix by calling Integer#parseInt(String, int).

public long

Returns:

the long value represented by this CharSeq in decimal
parseLong
()

Parses this CharSeq as a signed decimal long by calling Long#parseLong(String).

public long

Returns:

the long value represented by this CharSeq in the specified radix
parseLong
(int
the radix to be used in interpreting this CharSeq
radix
)

Parses this CharSeq as a signed long in the specified radix by calling Long#parseLong(String, int).

public short

Returns:

the short value represented by this CharSeq in decimal
parseShort
()

Parses this CharSeq as a signed decimal short by calling Short#parseShort(String).

public short

Returns:

the short value represented by this CharSeq in the specified radix
parseShort
(int
the radix to be used in interpreting this CharSeq
radix
)

Parses this CharSeq as a signed short in the specified radix by calling Short#parseShort(String, int).

public int

Returns:

the unsigned int value represented by this CharSeq in decimal
parseUnsignedInt
()

Parses this CharSeq as a unsigned decimal int by calling Integer#parseUnsignedInt(String).

public int

Returns:

the unsigned int value represented by this CharSeq in the specified radix
parseUnsignedInt
(int
the radix to be used in interpreting this CharSeq
radix
)

Parses this CharSeq as a unsigned int in the specified radix by calling Integer#parseUnsignedInt(String, int).

public long

Returns:

the unsigned long value represented by this CharSeq in decimal
parseUnsignedLong
()

Parses this CharSeq as a unsigned decimal long by calling Long#parseUnsignedLong(String).

public long

Returns:

the unsigned long value represented by this CharSeq in the specified radix
parseUnsignedLong
(int
the radix to be used in interpreting this CharSeq
radix
)

Parses this CharSeq as a unsigned long in the specified radix by calling Long#parseUnsignedLong(String, int).

public Tuple2<CharSeq, CharSeq>
partition(Predicate<? super Character>
A predicate which classifies an element if it is in the first or the second traversable.
predicate
)

Implements io.vavr.collection.IndexedSeq.partition.

Creates a partition of this Traversable by splitting this elements in two in distinct traversables according to a predicate.

public CharSeq
patch(int
the index of the first replaced element
from
,
Iterable<? extends Character>
sequence for replacement
that
,
int
the number of elements to drop in the original list
replaced
)

Implements io.vavr.collection.IndexedSeq.patch.

Produces a new list where a slice of elements in this list is replaced by another sequence.

public CharSeq
peek(Consumer<? super Character>
The action that will be performed on the element(s).
action
)

Implements io.vavr.collection.IndexedSeq.peek.

Performs the given action on the first element if this is an eager implementation.

public IndexedSeq<CharSeq>
permutations()

Implements io.vavr.collection.IndexedSeq.permutations.

Computes all unique permutations.

public CharSeq
prepend(Character
An element
element
)

Implements io.vavr.collection.IndexedSeq.prepend.

Prepends an element to this.

public CharSeq
prependAll(Iterable<? extends Character>
An Iterable of elements
elements
)

Implements io.vavr.collection.IndexedSeq.prependAll.

Prepends all given elements to this.

public static CharSeq

Returns:

a range of characters as specified or the empty range if from >= toExclusive
range
(char
the first character
from
,
char
the successor of the last character
toExclusive
)

Creates a CharSeq starting from character from, extending to character toExclusive - 1.

public static CharSeq
rangeBy(char from, char toExclusive, int step)

public static CharSeq

Returns:

a range of characters as specified or the empty range if from > toInclusive
rangeClosed
(char
the first character
from
,
char
the last character
toInclusive
)

Creates a CharSeq starting from character from, extending to character toInclusive.

public static CharSeq

Returns:

a range of characters as specified or the empty range if step * (from - toInclusive) > 0.
rangeClosedBy
(char
the first character
from
,
char
the last character
toInclusive
,
int
the step
step
)

Creates a CharSeq starting from character from, extending to character toInclusive, with step.

private Object
public boolean

Returns:

true if the specified subregion of this string exactly matches the specified subregion of the string argument; false otherwise.
regionMatches
(int
the starting offset of the subregion in this string.
toffset
,
CharSeq
the string argument.
other
,
int
the starting offset of the subregion in the string argument.
ooffset
,
int
the number of characters to compare.
len
)

Tests if two string regions are equal.

public boolean

Returns:

true if the specified subregion of this string matches the specified subregion of the string argument; false otherwise. Whether the matching is exact or case insensitive depends on the ignoreCase argument.
regionMatches
(boolean
if true, ignore case when comparing characters.
ignoreCase
,
int
the starting offset of the subregion in this string.
toffset
,
CharSeq
the string argument.
other
,
int
the starting offset of the subregion in the string argument.
ooffset
,
int
the number of characters to compare.
len
)

Tests if two string regions are equal.

public CharSeq
reject(Predicate<? super Character>
A predicate
predicate
)

Implements io.vavr.collection.IndexedSeq.reject.

Returns a new traversable consisting of all elements which do not satisfy the given predicate.

public CharSeq
remove(Character
An element to be removed from this Seq.
element
)

Implements io.vavr.collection.IndexedSeq.remove.

Removes the first occurrence of the given element.

public CharSeq
removeAll(Character
An element to be removed from this Seq.
element
)

Implements io.vavr.collection.IndexedSeq.removeAll.

Removes all occurrences of the given element.

public CharSeq
removeAll(Iterable<? extends Character>
Elements to be removed from this Seq.
elements
)

Implements io.vavr.collection.IndexedSeq.removeAll, io.vavr.collection.IndexedSeq.removeAll.

Removes all occurrences of the given elements.

public CharSeq
removeAll(Predicate<? super Character>
the predicate used to test elements
predicate
)

Implements io.vavr.collection.IndexedSeq.removeAll, io.vavr.collection.IndexedSeq.removeAll.

Deprecated

Returns a new Seq consisting of all elements which do not satisfy the given predicate.

public CharSeq
removeAt(int
position of element to remove
index
)

Implements io.vavr.collection.IndexedSeq.removeAt.

Removes the element at the specified position in this sequence.

public CharSeq
removeFirst(Predicate<Character>
an predicate
predicate
)

Implements io.vavr.collection.IndexedSeq.removeFirst.

Removes the first occurrence that satisfy predicate

public CharSeq
removeLast(Predicate<Character>
an predicate
predicate
)

Implements io.vavr.collection.IndexedSeq.removeLast.

Removes the last occurrence that satisfy predicate

public static CharSeq

Returns:

A CharSeq representing character * times
repeat
(char
A character
character
,
int
Repetition count
times
)

Repeats a character times times.

public CharSeq

Returns:

A CharSeq representing this * times
repeat
(int
Repetition count
times
)

Repeats this CharSeq times times.

public CharSeq
replace(Character
An element to be substituted.
currentElement
,
Character
A replacement for currentElement.
newElement
)

Implements io.vavr.collection.IndexedSeq.replace.

Replaces the first occurrence (if exists) of the given currentElement with newElement.

public CharSeq

Returns:

The resulting string
replace
(CharSequence
The sequence of char values to be replaced
target
,
CharSequence
The replacement sequence of char values
replacement
)

Implements io.vavr.collection.IndexedSeq.replace.

Replaces each substring of this string that matches the literal target sequence with the specified literal replacement sequence.

public CharSeq
replaceAll(Character
An element to be substituted.
currentElement
,
Character
A replacement for currentElement.
newElement
)

Implements io.vavr.collection.IndexedSeq.replaceAll.

Replaces all occurrences of the given currentElement with newElement.

public CharSeq

Returns:

The resulting CharSeq
replaceAll
(String
the regular expression to which this string is to be matched
regex
,
String
the string to be substituted for each match
replacement
)

Implements io.vavr.collection.IndexedSeq.replaceAll.

Replaces each substring of this string that matches the given regular expression with the given replacement.

public CharSeq

Returns:

The resulting CharSeq
replaceFirst
(String
the regular expression to which this string is to be matched
regex
,
String
the string to be substituted for the first match
replacement
)

Replaces the first substring of this string that matches the given regular expression with the given replacement.

public CharSeq
retainAll(Iterable<? extends Character>
Elements to be kept.
elements
)

Implements io.vavr.collection.IndexedSeq.retainAll.

Keeps all occurrences of the given elements from this.

public CharSeq
reverse()

Implements io.vavr.collection.IndexedSeq.reverse.

Reverses the order of elements.

public CharSeq
rotateLeft(int
distance of left rotation
n
)

Implements io.vavr.collection.IndexedSeq.rotateLeft.

Circular rotates the elements by the specified distance to the left direction.

public CharSeq
rotateRight(int
distance of right rotation
n
)

Implements io.vavr.collection.IndexedSeq.rotateRight.

Circular rotates the elements by the specified distance to the right direction.

public CharSeq
scan(Character
neutral element for the operator op
zero
,
BiFunction<? super Character, ? super Character, ? extends Character>
the associative operator for the scan
operation
)

Implements io.vavr.collection.IndexedSeq.scan.

Computes a prefix scan of the elements of the collection.

public <U> IndexedSeq<U>
scanLeft(U
the initial value
zero
,
BiFunction<? super U, ? super Character, ? extends U>
the binary operator applied to the intermediate result and the element
operation
)

Implements io.vavr.collection.IndexedSeq.scanLeft.

Produces a collection containing cumulative results of applying the operator going left to right.

public <U> IndexedSeq<U>
scanRight(U
the initial value
zero
,
BiFunction<? super Character, ? super U, ? extends U>
the binary operator applied to the intermediate result and the element
operation
)

Implements io.vavr.collection.IndexedSeq.scanRight.

Produces a collection containing cumulative results of applying the operator going right to left.

public CharSeq
shuffle()

Implements io.vavr.collection.IndexedSeq.shuffle.

Randomize the order of the elements in the current sequence.

public CharSeq
slice(int
the beginning index, inclusive
beginIndex
,
int
the end index, exclusive
endIndex
)

Implements io.vavr.collection.IndexedSeq.slice.

Returns a Seq that is a slice of this.

public Iterator<CharSeq>
slideBy(Function<? super Character, ?>
A function which classifies elements into classes
classifier
)

Implements io.vavr.collection.IndexedSeq.slideBy.

Slides a non-overlapping window of a variable size over this Traversable.

public Iterator<CharSeq>
sliding(int
a positive window size
size
)

Implements io.vavr.collection.IndexedSeq.sliding.

Slides a window of a specific size and step size 1 over this Traversable by calling sliding(int, int).

public Iterator<CharSeq>
sliding(int
a positive window size
size
,
int
a positive step size
step
)

Implements io.vavr.collection.IndexedSeq.sliding.

Slides a window of a specific size and step size over this Traversable.

public <U extends Comparable<? super U>> CharSeq
sortBy(Function<? super Character, ? extends U>
A mapper
mapper
)

Implements io.vavr.collection.IndexedSeq.sortBy.

Sorts this elements by comparing the elements in a different domain, using the given mapper.

public <U> CharSeq
sortBy(Comparator<? super U>
A comparator
comparator
,
Function<? super Character, ? extends U>
A mapper
mapper
)

Implements io.vavr.collection.IndexedSeq.sortBy.

Sorts this elements by comparing the elements in a different domain, using the given mapper.

public CharSeq
sorted()

Implements io.vavr.collection.IndexedSeq.sorted.

Sorts this elements according to their natural order.

public CharSeq
sorted(Comparator<? super Character>
A comparator
comparator
)

Implements io.vavr.collection.IndexedSeq.sorted.

Sorts this elements according to the provided Comparator.

public Tuple2<CharSeq, CharSeq>
span(Predicate<? super Character>
A predicate.
predicate
)

Implements io.vavr.collection.IndexedSeq.span.

Returns a tuple where the first element is the longest prefix of elements that satisfy the given predicate and the second element is the remainder.

public Seq<CharSeq>

Returns:

the Seq of strings computed by splitting this string around matches of the given regular expression
split
(String
the delimiting regular expression
regex
)

Splits this string around matches of the given regular expression.

public Seq<CharSeq>

Returns:

the Seq of strings computed by splitting this string around matches of the given regular expression
split
(String
the delimiting regular expression
regex
,
int
the result threshold, as described above
limit
)

Splits this string around matches of the given regular expression.

public Tuple2<CharSeq, CharSeq>
splitAt(int
An index.
n
)

Implements io.vavr.collection.Seq.splitAt.

Splits a Seq at the specified index.

public Tuple2<CharSeq, CharSeq>
splitAt(Predicate<? super Character>
An predicate
predicate
)

Implements io.vavr.collection.Seq.splitAt.

Splits a sequence at the first element which satisfies the Predicate, e.g. Tuple(init, element+tail).

public Tuple2<CharSeq, CharSeq>
splitAtInclusive(Predicate<? super Character>
An predicate
predicate
)

Implements io.vavr.collection.Seq.splitAtInclusive.

Splits a sequence at the first element which satisfies the Predicate, e.g. Tuple(init+element, tail).

private Tuple2<CharSeq, CharSeq>
public boolean
startsWith(Iterable<? extends Character>
the sequence to test
that
,
int
the index where the sequence is searched.
offset
)

Overrides default io.vavr.collection.IndexedSeq.startsWith.

Tests whether this list contains the given sequence at a given index.

public boolean

Returns:

true if the character sequence represented by the argument is a prefix of the substring of this object starting at index toffset; false otherwise. The result is false if toffset is negative or greater than the length of this CharSeq object; otherwise the result is the same as the result of the expression
         this.substring(toffset).startsWith(prefix)
         
startsWith
(CharSeq
the prefix.
prefix
,
int
where to begin looking in this string.
toffset
)

Tests if the substring of this string beginning at the specified index starts with the specified prefix.

public boolean

Returns:

true if the character sequence represented by the argument is a prefix of the character sequence represented by this string; false otherwise. Note also that true will be returned if the argument is an empty string or is equal to this CharSeq object as determined by the equals(Object) method.
startsWith
(CharSeq
the prefix.
prefix
)

Tests if this string starts with the specified prefix.

public String
stringPrefix()

Implements io.vavr.Value.stringPrefix.

Returns the name of this Value type, which is used by toString().

public CharSeq
subSequence(int
the beginning index, inclusive
beginIndex
)

Implements io.vavr.collection.IndexedSeq.subSequence.

Returns a Seq that is a subsequence of this.

public CharSeq
subSequence(int
the start index, inclusive
beginIndex
,
int
the end index, exclusive
endIndex
)

Implements java.lang.CharSequence.subSequence, io.vavr.collection.IndexedSeq.subSequence.

Returns a CharSequence that is a subsequence of this sequence.

public CharSeq

Returns:

the specified substring.
substring
(int
the beginning index, inclusive.
beginIndex
)

Returns a string that is a substring of this string.

public CharSeq

Returns:

the specified substring.
substring
(int
the beginning index, inclusive.
beginIndex
,
int
the ending index, exclusive.
endIndex
)

Returns a string that is a substring of this string.

public static CharSeq

Returns:

A CharSeq consisting of elements f(0),f(1), ..., f(n - 1)
tabulate
(int
The number of elements in the CharSeq
n
,
Function<? super Integer, ? extends Character>
The Function computing element values
f
)

Returns a CharSeq containing n values of a given Function f over a range of integer values from 0 to n - 1.

public CharSeq
tail()

Implements io.vavr.collection.IndexedSeq.tail.

Drops the first element of a non-empty Traversable.

public Option<CharSeq>
tailOption()

Implements io.vavr.collection.IndexedSeq.tailOption.

Drops the first element of a non-empty Traversable and returns an Option.

public CharSeq
take(int
The number of elements to take.
n
)

Implements io.vavr.collection.IndexedSeq.take.

Takes the first n elements of this or all elements, if this length < n.

public CharSeq
takeRight(int
The number of elements to take.
n
)

Implements io.vavr.collection.IndexedSeq.takeRight.

Takes the last n elements of this or all elements, if this length < n.

public CharSeq
takeRightUntil(Predicate<? super Character>
A condition tested subsequently for this elements, starting from the end.
predicate
)

Implements io.vavr.collection.IndexedSeq.takeRightUntil.

Takes elements until the predicate holds for the current element, starting from the end.

public CharSeq
takeRightWhile(Predicate<? super Character>
A condition tested subsequently for this elements, starting from the end.
predicate
)

Implements io.vavr.collection.IndexedSeq.takeRightWhile.

Takes elements while the predicate holds for the current element, starting from the end.

public CharSeq
takeUntil(Predicate<? super Character>
A condition tested subsequently for this elements.
predicate
)

Implements io.vavr.collection.IndexedSeq.takeUntil.

Takes elements until the predicate holds for the current element.

public CharSeq
takeWhile(Predicate<? super Character>
A condition tested subsequently for the contained elements.
predicate
)

Implements io.vavr.collection.IndexedSeq.takeWhile.

Takes elements while the predicate holds for the current element.

public Boolean

Returns:

the Boolean value represented by this CharSeq
toBoolean
()

Converts this CharSeq to a Boolean by calling Boolean#valueOf(String).

public Byte

Returns:

a Byte object holding the value represented by this CharSeq
toByte
()

Converts this CharSeq to a Byte by calling Byte#valueOf(String).

public Byte

Returns:

a Byte object holding the value represented by this CharSeq
toByte
(int
the radix to be used in interpreting this char sequence
radix
)

Converts this CharSeq to a Byte in the specified radix by calling Byte#valueOf(String, int).

public char[]

Returns:

a newly allocated character array whose length is the length of this string and whose contents are initialized to contain the character sequence represented by this string.
toCharArray
()

Converts this string to a new character array.

public Double

Returns:

a Double object holding the value represented by this CharSeq
toDouble
()

Converts this CharSeq to a Double by calling Double#valueOf(String).

public Float

Returns:

a Float object holding the value represented by this CharSeq
toFloat
()

Converts this CharSeq to a Float by calling Float#valueOf(String).

public Integer

Returns:

an Integer object holding the value represented by this CharSeq
toInteger
()

Converts this CharSeq to an Integer by calling Integer#valueOf(String).

public Integer

Returns:

an Integer object holding the value represented by this CharSeq
toInteger
(int
the radix to be used in interpreting this char sequence
radix
)

Converts this CharSeq to an Integer in the specified radix by calling Integer#valueOf(String, int).

public Character[]
toJavaArray()

Overrides default io.vavr.Value.toJavaArray.

Converts this to a Java array with component type Object

// = [] of type Object[]
Future.
public Long

Returns:

a Long object holding the value represented by this CharSeq
toLong
()

Converts this CharSeq to a Long by calling Long#valueOf(String).

public Long

Returns:

a Long object holding the value represented by this CharSeq
toLong
(int
the radix to be used in interpreting this char sequence
radix
)

Converts this CharSeq to a Long in the specified radix by calling Long#valueOf(String, int).

public CharSeq

Returns:

the CharSeq, converted to lowercase.
toLowerCase
(Locale
use the case transformation rules for this locale
locale
)

Converts all of the characters in this CharSeq to lower case using the rules of the given Locale.

public CharSeq

Returns:

the CharSeq, converted to lowercase.
toLowerCase
()

Converts all of the characters in this CharSeq to lower case using the rules of the default locale.

public Short

Returns:

a Short object holding the value represented by this CharSeq
toShort
()

Converts this CharSeq to a Short by calling Short#valueOf(String).

public Short

Returns:

a Short object holding the value represented by this CharSeq
toShort
(int
the radix to be used in interpreting this char sequence
radix
)

Converts this CharSeq to a Short in the specified radix by calling Short#valueOf(String, int).

public String

Returns:

a string consisting of exactly this sequence of characters
toString
()

Overrides java.lang.Object.toString.

Implements java.lang.CharSequence.toString, io.vavr.Value.toString.

Returns a string containing the characters in this sequence in the same order as this sequence.

public CharSeq

Returns:

the CharSeq, converted to uppercase.
toUpperCase
(Locale
use the case transformation rules for this locale
locale
)

Converts all of the characters in this CharSeq to upper case using the rules of the given Locale.

public CharSeq

Returns:

the CharSeq, converted to uppercase.
toUpperCase
()

Converts all of the characters in this CharSeq to upper case using the rules of the default locale.

public <
Type of transformation result
U
>
U

Returns:

An instance of type U
transform
(Function<? super CharSeq, ? extends U>
A transformation
f
)

Transforms this CharSeq.

public CharSeq

Returns:

A string whose value is this string, with any leading and trailing white space removed, or this string if it has no leading or trailing white space.
trim
()

Returns a string whose value is this string, with any leading and trailing whitespace removed.

public static CharSeq

Returns:

a CharSeq with the values built up by the iteration
unfold
(Character
the start value for the iteration
seed
,
Function<? super Character, Option<Tuple2<? extends Character, ? extends Character>>>
the function to get the next step of the iteration
f
)

Creates a CharSeq from a seed value and a function.

public static <
type of seeds
T
>
CharSeq

Returns:

a CharSeq with the values built up by the iteration
unfoldLeft
(T
the start value for the iteration
seed
,
Function<? super T, Option<Tuple2<? extends T, ? extends Character>>>
the function to get the next step of the iteration
f
)

Creates a CharSeq from a seed value and a function.

public static <
type of seeds
T
>
CharSeq

Returns:

a CharSeq with the values built up by the iteration
unfoldRight
(T
the start value for the iteration
seed
,
Function<? super T, Option<Tuple2<? extends Character, ? extends T>>>
the function to get the next step of the iteration
f
)

Creates a CharSeq from a seed value and a function.

public <T1, T2> Tuple2<IndexedSeq<T1>, IndexedSeq<T2>>
unzip(Function<? super Character, Tuple2<? extends T1, ? extends T2>>
a function which converts elements of this to pairs
unzipper
)

Implements io.vavr.collection.IndexedSeq.unzip.

Unzips this elements by mapping this elements to pairs which are subsequently split into two distinct sets.

public <T1, T2, T3> Tuple3<IndexedSeq<T1>, IndexedSeq<T2>, IndexedSeq<T3>>
unzip3(Function<? super Character, Tuple3<? extends T1, ? extends T2, ? extends T3>>
a function which converts elements of this to pairs
unzipper
)

Implements io.vavr.collection.IndexedSeq.unzip3.

Unzips this elements by mapping this elements to triples which are subsequently split into three distinct sets.

public CharSeq
update(int
an index
index
,
Character
an element
element
)

Implements io.vavr.collection.IndexedSeq.update.

Updates the given element at the specified index.

public CharSeq
update(int
an index
index
,
Function<? super Character, ? extends Character>
a function transforming the previous value
updater
)

Implements io.vavr.collection.IndexedSeq.update, io.vavr.collection.IndexedSeq.update.

Updates the given element at the specified index using the specified function.

public <U> IndexedSeq<Tuple2<Character, U>>
zip(Iterable<? extends U>
The Iterable providing the second half of each result pair.
that
)

Implements io.vavr.collection.IndexedSeq.zip.

Returns a traversable formed from this traversable and another Iterable collection by combining corresponding elements in pairs.

public <U> IndexedSeq<Tuple2<Character, U>>
zipAll(Iterable<? extends U>
The Iterable providing the second half of each result pair.
that
,
Character
The element to be used to fill up the result if this traversable is shorter than that.
thisElem
,
U
The element to be used to fill up the result if that is shorter than this traversable.
thatElem
)

Implements io.vavr.collection.IndexedSeq.zipAll.

Returns a traversable formed from this traversable and another Iterable by combining corresponding elements in pairs.

public <U, R> IndexedSeq<R>
zipWith(Iterable<? extends U>
The Iterable providing the second parameter of the mapper.
that
,
BiFunction<? super Character, ? super U, ? extends R>
a mapper.
mapper
)

Implements io.vavr.collection.IndexedSeq.zipWith.

Returns a traversable formed from this traversable and another Iterable collection by mapping elements.

public IndexedSeq<Tuple2<Character, Integer>>
zipWithIndex()

Implements io.vavr.collection.IndexedSeq.zipWithIndex.

Zips this traversable with its indices.

public <U> IndexedSeq<U>
zipWithIndex(BiFunction<? super Character, ? super Integer, ? extends U>
a mapper.
mapper
)

Implements io.vavr.collection.IndexedSeq.zipWithIndex.

Zips this traversable with its indices by applying mapper provided.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait