abstract class CharacterUtils extends AnyRef
CharacterUtils
provides a unified interface to Character-related
operations.
- Alphabetic
- By Inheritance
- CharacterUtils
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new CharacterUtils()
Abstract Value Members
-
abstract
def
codePointAt(chars: Array[Char], offset: Int, limit: Int): Int
Returns the code point at the given index of the char array where only elements with index less than the limit are used.
Returns the code point at the given index of the char array where only elements with index less than the limit are used.
- chars
a character array
- offset
the offset to the char values in the chars array to be converted
- limit
the index afer the last element that should be used to calculate codepoint.
- returns
the Unicode code point at the given index
- Exceptions thrown
IndexOutOfBoundsException
- if the value offset is negative or not less than the length of the char array.NullPointerException
- if the array is null.
-
abstract
def
codePointAt(seq: CharSequence, offset: Int): Int
Returns the code point at the given index of the
CharSequence
.Returns the code point at the given index of the
CharSequence
.- seq
a character sequence
- offset
the offset to the char values in the chars array to be converted
- returns
the Unicode code point at the given index
- Exceptions thrown
IndexOutOfBoundsException
- if the value offset is negative or not less than the length of the character sequence.NullPointerException
- if the sequence is null.
-
abstract
def
codePointCount(seq: CharSequence): Int
Return the number of characters in
seq
.Return the number of characters in
seq
. -
abstract
def
fill(buffer: CharacterBuffer, reader: Reader, numChars: Int): Boolean
Fills the
CharacterBuffer
with characters read from the given readerReader
.Fills the
CharacterBuffer
with characters read from the given readerReader
. This method tries to readnumChars
characters into theCharacterBuffer
, each call to fill will start filling the buffer from offset0
up tonumChars
. In case code points can span across 2 java characters, this method may only fillnumChars - 1
characters in order not to split in the middle of a surrogate pair, even if there are remaining characters in theReader
.A return value of
false
means that this method call exhausted the reader, but there may be some bytes which have been read, which can be verified by checking whetherbuffer.getLength() > 0
.- buffer
the buffer to fill.
- reader
the reader to read characters from.
- numChars
the number of chars to read
- returns
false
if and only if reader.read returned -1 while trying to fill the buffer
- Exceptions thrown
IOException
if the reader throws anIOException
.
-
abstract
def
offsetByCodePoints(buf: Array[Char], start: Int, count: Int, index: Int, offset: Int): Int
Return the index within
buf[start:start+count]
which is byoffset
code points fromindex
.Return the index within
buf[start:start+count]
which is byoffset
code points fromindex
.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
fill(buffer: CharacterBuffer, reader: Reader): Boolean
Convenience method which calls
fill(buffer, reader, buffer.buffer.length)
.Convenience method which calls
fill(buffer, reader, buffer.buffer.length)
. -
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
toChars(src: Array[Int], srcOff: Int, srcLen: Int, dest: Array[Char], destOff: Int): Int
Converts a sequence of unicode code points to a sequence of Java characters.
Converts a sequence of unicode code points to a sequence of Java characters.
- returns
the number of chars written to the destination buffer
-
final
def
toCodePoints(src: Array[Char], srcOff: Int, srcLen: Int, dest: Array[Int], destOff: Int): Int
Converts a sequence of Java characters to a sequence of unicode code points.
Converts a sequence of Java characters to a sequence of unicode code points.
- returns
the number of code points written to the destination buffer
-
final
def
toLowerCase(buffer: Array[Char], offset: Int, limit: Int): Unit
Converts each unicode codepoint to lowerCase via
Character#toLowerCase(int)
starting at the given offset.Converts each unicode codepoint to lowerCase via
Character#toLowerCase(int)
starting at the given offset.- buffer
the char buffer to lowercase
- offset
the offset to start at
- limit
the max char in the buffer to lower case
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
toUpperCase(buffer: Array[Char], offset: Int, limit: Int): Unit
Converts each unicode codepoint to UpperCase via
Character#toUpperCase(int)
starting at the given offset.Converts each unicode codepoint to UpperCase via
Character#toUpperCase(int)
starting at the given offset.- buffer
the char buffer to UPPERCASE
- offset
the offset to start at
- limit
the max char in the buffer to lower case
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )