BiDirIntIterator, IndexIterator, IntIteratorpublic abstract class CodePointIterator extends java.lang.Object implements BiDirIntIterator, IndexIterator
| Modifier and Type | Field | Description |
|---|---|---|
static CodePointIterator |
EMPTY |
The empty code point iterator.
|
| Modifier and Type | Method | Description |
|---|---|---|
ByteIterator |
asLatin1() |
Get a byte iterator over the latin-1 encoding of this code point iterator.
|
ByteIterator |
asUtf8() |
Get a byte iterator over the UTF-8 encoding of this code point iterator.
|
ByteIterator |
asUtf8(boolean escapeNul) |
Get a byte iterator over the UTF-8 encoding of this code point iterator.
|
ByteIterator |
base32Decode() |
Base32-decode the current stream.
|
ByteIterator |
base32Decode(Base32Alphabet alphabet) |
Base32-decode the current stream.
|
ByteIterator |
base32Decode(Base32Alphabet alphabet,
boolean requirePadding) |
Base32-decode the current stream.
|
ByteIterator |
base64Decode() |
Base64-decode the current stream.
|
ByteIterator |
base64Decode(Base64Alphabet alphabet) |
Base64-decode the current stream.
|
ByteIterator |
base64Decode(Base64Alphabet alphabet,
boolean requirePadding) |
Base64-decode the current stream.
|
boolean |
contentEquals(java.lang.String other) |
Determine if the remaining contents of this iterator are identical to the given string.
|
boolean |
contentEquals(CodePointIterator other) |
Determine if the remaining contents of this iterator are identical to the remaining contents of the other iterator.
|
CodePointIterator |
delimitedBy(int... delims) |
Get a sub-iterator that is delimited by the given code points.
|
java.lang.StringBuilder |
drainTo(java.lang.StringBuilder b) |
Drain all the remaining code points in this iterator to the given string builder.
|
java.lang.StringBuilder |
drainTo(java.lang.StringBuilder b,
int delim,
int n) |
Drain all the remaining code points in this iterator to the given string builder,
inserting the given delimiter after every
n code points. |
java.lang.StringBuilder |
drainTo(java.lang.StringBuilder b,
java.lang.String prefix,
int n) |
Drain all the remaining code points in this iterator to the given string builder,
inserting the given prefix before every
n code points. |
java.lang.StringBuilder |
drainTo(java.lang.StringBuilder b,
java.lang.String prefix,
int delim,
int n) |
Drain all the remaining code points in this iterator to the given string builder,
inserting the given prefix and delimiter before and after every
n code points,
respectively. |
java.lang.String |
drainToString() |
Drain all the remaining code points in this iterator to a new string.
|
java.lang.String |
drainToString(int delim,
int n) |
Drain all the remaining code points in this iterator to a new string,
inserting the given delimiter after every
n code points. |
java.lang.String |
drainToString(java.lang.String prefix,
int n) |
Drain all the remaining code points in this iterator to a new string,
inserting the given prefix before every
n code points. |
java.lang.String |
drainToString(java.lang.String prefix,
int delim,
int n) |
Drain all the remaining code points in this iterator to a new string,
inserting the given prefix and delimiter before and after every
n
code points, respectively. |
abstract long |
getIndex() |
Get the current offset, by code point.
|
abstract boolean |
hasNext() |
Determine if there are more code points after the current code point.
|
abstract boolean |
hasPrevious() |
Determine if there are more code points before the current code point.
|
ByteIterator |
hexDecode() |
Hex-decode the current stream.
|
CodePointIterator |
limitedTo(long size) |
Return a copy of this iterator which is limited to the given number of code points after the current one.
|
abstract int |
next() |
Get the next code point.
|
static CodePointIterator |
ofChars(char[] chars) |
Get a code point iterator for a character array.
|
static CodePointIterator |
ofChars(char[] chars,
int offs) |
Get a code point iterator for a character array.
|
static CodePointIterator |
ofChars(char[] chars,
int offs,
int len) |
Get a code point iterator for a character array.
|
static CodePointIterator |
ofLatin1Bytes(byte[] bytes) |
Get a code point iterator for a ISO-8859-1 (Latin-1) encoded array.
|
static CodePointIterator |
ofLatin1Bytes(byte[] bytes,
int offs,
int len) |
Get a code point iterator for a ISO-8859-1 (Latin-1) encoded array.
|
static CodePointIterator |
ofString(java.lang.String string) |
Get a code point iterator for a string.
|
static CodePointIterator |
ofString(java.lang.String string,
int offs,
int len) |
Get a code point iterator for a string.
|
static CodePointIterator |
ofUtf8Bytes(byte[] bytes) |
Get a code point iterator for a UTF-8 encoded byte array.
|
static CodePointIterator |
ofUtf8Bytes(byte[] bytes,
int offs,
int len) |
Get a code point iterator for a UTF-8 encoded array.
|
abstract int |
peekNext() |
Peek at the next code point without advancing.
|
abstract int |
peekPrevious() |
Peek at the previous code point without moving backwards.
|
abstract int |
previous() |
Get the previous code point.
|
CodePointIterator |
skip(java.util.function.IntPredicate predicate) |
Get a sub-iterator that removes code points based on a
predicate. |
CodePointIterator |
skipAll() |
Skip all the remaining code points in this iterator.
|
CodePointIterator |
skipCrLf() |
Get a sub-iterator that removes the following code points:
10(\n) and 13(\r). |
public static final CodePointIterator EMPTY
public abstract boolean hasNext()
hasNext in interface BiDirIntIteratorhasNext in interface IntIteratortrue if there are more code points, false otherwisepublic abstract boolean hasPrevious()
hasPrevious in interface BiDirIntIteratortrue if there are more code points, false otherwisepublic abstract int next()
throws java.util.NoSuchElementException
next in interface BiDirIntIteratornext in interface IntIteratorjava.util.NoSuchElementException - if hasNext() returns falsepublic abstract int peekNext()
throws java.util.NoSuchElementException
peekNext in interface BiDirIntIteratorpeekNext in interface IntIteratorjava.util.NoSuchElementException - if hasNext() returns falsepublic abstract int previous()
throws java.util.NoSuchElementException
previous in interface BiDirIntIteratorjava.util.NoSuchElementException - if hasPrevious() returns falsepublic abstract int peekPrevious()
throws java.util.NoSuchElementException
peekPrevious in interface BiDirIntIteratorjava.util.NoSuchElementException - if hasPrevious() returns falsepublic abstract long getIndex()
getIndex in interface IndexIteratorpublic final boolean contentEquals(CodePointIterator other)
next() will be the differing code point. If the contents are equal, the iterators will both be
positioned at the end of their contents.other - the other byte iteratortrue if the contents are equal, false otherwisepublic boolean contentEquals(java.lang.String other)
next() will be the differing code point. If the contents are equal, the iterator will be
positioned at the end of its contents.other - the other stringtrue if the contents are equal, false otherwisepublic final CodePointIterator limitedTo(long size)
size - the number of code pointspublic final CodePointIterator delimitedBy(int... delims)
false for hasNext() if the next
character in the encapsulated iterator is a delimiter or if the underlying iterator returns false for
hasNext().delims - the code point delimiterspublic java.lang.StringBuilder drainTo(java.lang.StringBuilder b)
b - the string builderpublic CodePointIterator skipAll()
delimitedBy(int...))public java.lang.StringBuilder drainTo(java.lang.StringBuilder b,
java.lang.String prefix,
int delim,
int n)
n code points,
respectively.b - the string builderprefix - the prefixdelim - the delimitern - the number of code points between each prefix and delimiterpublic java.lang.StringBuilder drainTo(java.lang.StringBuilder b,
int delim,
int n)
n code points.b - the string builderdelim - the delimitern - the number of code points between each delimiterpublic java.lang.StringBuilder drainTo(java.lang.StringBuilder b,
java.lang.String prefix,
int n)
n code points.b - the string builderprefix - the prefixn - the number of code points between each prefixpublic java.lang.String drainToString()
public java.lang.String drainToString(java.lang.String prefix,
int delim,
int n)
n
code points, respectively.prefix - the prefixdelim - the delimitern - the number of code points between each prefix and delimiterpublic java.lang.String drainToString(int delim,
int n)
n code points.delim - the delimitern - the number of code points between each delimiterpublic java.lang.String drainToString(java.lang.String prefix,
int n)
n code points.prefix - the prefixn - the number of code points between each prefixpublic ByteIterator base64Decode(Base64Alphabet alphabet, boolean requirePadding)
alphabet - the alphabet to userequirePadding - true to require padding, false if padding is optionalpublic ByteIterator base32Decode(Base32Alphabet alphabet, boolean requirePadding)
alphabet - the alphabet to userequirePadding - true to require padding, false if padding is optionalpublic ByteIterator hexDecode()
public ByteIterator base64Decode(Base64Alphabet alphabet)
alphabet - the alphabet to usepublic ByteIterator base64Decode()
public ByteIterator base32Decode(Base32Alphabet alphabet)
alphabet - the alphabet to usepublic ByteIterator base32Decode()
public ByteIterator asLatin1()
public ByteIterator asUtf8()
public ByteIterator asUtf8(boolean escapeNul)
escapeNul - true to escape NUL (0) characters as two bytes, false to encode them as one bytepublic static CodePointIterator ofString(java.lang.String string)
string - the stringpublic static CodePointIterator ofString(java.lang.String string, int offs, int len)
string - the stringpublic static CodePointIterator ofChars(char[] chars)
chars - the arraypublic static CodePointIterator ofChars(char[] chars, int offs)
chars - the arrayoffs - the array offsetpublic static CodePointIterator ofChars(char[] chars, int offs, int len)
chars - the arrayoffs - the array offsetlen - the number of characters to includepublic static CodePointIterator ofUtf8Bytes(byte[] bytes)
bytes - the arraypublic static CodePointIterator ofUtf8Bytes(byte[] bytes, int offs, int len)
bytes - the arrayoffs - the array offsetlen - the number of characters to includepublic static CodePointIterator ofLatin1Bytes(byte[] bytes)
bytes - the arraypublic static CodePointIterator ofLatin1Bytes(byte[] bytes, int offs, int len)
bytes - the arrayoffs - the array offsetlen - the number of characters to includepublic CodePointIterator skipCrLf()
10(\n) and 13(\r).public CodePointIterator skip(java.util.function.IntPredicate predicate)
predicate.predicate - a IntPredicate that evaluates the code points that should be skipper. Returning true from the predicate
indicates that the code point must be skipped.Copyright © 2017 JBoss, a division of Red Hat, Inc.