package scala

  1. Alphabetic
  1. Public
  2. Protected

Package Members

  1. package db
  2. package encoding
  3. package i18n
  4. package io
  5. package logging
  6. package parse
  7. package serialization
  8. package util
  9. package uui

Type Members

  1. class UChar extends UObject

    Represents a Unicode character.

    Represents a Unicode character. Internally, it maintains both codepoint and UTF-8 representations. Conversion from native Char to UChar is provided implicitly.

    val ch: UChar = 'c'

  2. trait UObject extends AnyRef

    A UObject can convert itself to UString

  3. class UString extends UObject

    High-performance string with internal UTF-8 encoding.

    High-performance string with internal UTF-8 encoding. Conveniently use interpolator U to create instances of UString.

    val myString = U"This is my string"  // type of myString is UString

    Conversion from native String to UString is provided implicitly.

    val myString: UString = "This is my string"

    The philosophy behind this class is that, more often than not, text data is stored and read in UTF-8 encoding, and written to output with little or no processing. Most often such process can be done at byte level (such as concatenation), and in cases when iteration of code points is required, it can be done directly over the UTF-8 stream. By avoiding unnecessary encoding and decoding to and from UTF-8, unlike Java String, we can save our CPU resources. Also since UTF-8 is the most compact Unicode representation, we save some memory as well.

    Use toUtf8() to get raw bytes consisting this string, or if necessary use uCharIterator() to read each character one-by-one.

    getLength() returns the length of string in characters rather than bytes. To get the number of bytes use getUtf8Length(). substring() methods also work based on character (codepoint) location, as one would naturally expect.

Value Members

  1. object UChar
  2. object UString