Package char
This package contains 2 source unit(s) defining 2 class(es) / struct(s). Each unit below lists its fields (the values it stores) and methods (the actions it performs), with a plain explanation of each.
SLChar #sleela 3.1 (lib/char/SLChar.sleela)
SLChar class
Helpers over the char type of SLEELA.syntax section 45: a char is an unsigned 16-bit UTF-16 code unit held in an integer slot. The methods classify and map ASCII and Latin-1 chars, convert between chars, codes and digits, and recognize surrogates. Chars beyond Latin-1 need the Unicode tables and are the business of the Java text tier.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
MIN_VALUE | static final int MIN_VALUE = 0 | Range of a char: an unsigned 16-bit UTF-16 code unit. |
MAX_VALUE | static final int MAX_VALUE = 65535 | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
toCode | static int toCode(char c) | The numeric code of a char (the char widened to int). |
fromCode | static char fromCode(int n) | The char with the low 16 bits of n (the narrowing every char store applies). |
toString | static String toString(char c) | No description in source. |
isDigit | static boolean isDigit(char c) | 48..57 are 0..9. |
isUpperCase | static boolean isUpperCase(char c) | ASCII A..Z (65..90) and the Latin-1 capitals 192..222 except 215. |
isLowerCase | static boolean isLowerCase(char c) | ASCII a..z (97..122) and the Latin-1 smalls 223..255 except 247. |
isLetter | static boolean isLetter(char c) | No description in source. |
isLetterOrDigit | static boolean isLetterOrDigit(char c) | No description in source. |
isWhitespace | static boolean isWhitespace(char c) | No description in source. |
toUpperCase | static char toUpperCase(char c) | Simple case mapping for ASCII and Latin-1 (one char to one char). |
toLowerCase | static char toLowerCase(char c) | No description in source. |
digitValue | static int digitValue(char c, int radix) | Value of c as a digit in the radix (2..36), or -1 when it is not one. |
forDigit | static char forDigit(int digit, int radix) | The lower-case digit char for a value in the radix, or NUL (0) when invalid. |
isHighSurrogate | static boolean isHighSurrogate(char c) | No description in source. |
isLowSurrogate | static boolean isLowSurrogate(char c) | No description in source. |
isSurrogate | static boolean isSurrogate(char c) | No description in source. |
toCodePoint | static int toCodePoint(char high, char low) | The code point of a surrogate pair. |
compare | static int compare(char a, char b) | Order of two chars by code, as a negative, zero or positive int. |
hashCode | static int hashCode(char c) | No description in source. |
SLPackage #sleela 3.0 (lib/char/SLPackage.sleela)
SLPackage class
Defines the SLeeLa standard-library package for the char type (syntax 3.1, section 45).
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
packageName | String packageName | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(String name) | No description in source. |
name | String name() | No description in source. |
available | boolean available() | No description in source. |