Package text
SLCharset #sleela 2.5 (lib/text/SLCharset.sleela)
SLCharset class
SLCharset -- a comprehensive character-set contract for the text >
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
value | String value = "UTF-8" | canonical charset name |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
utf8 | String utf8() | ---- well-known canonical names (in-language constants) ------------ |
utf16 | String utf16() | No description in source. |
utf16le | String utf16le() | No description in source. |
utf16be | String utf16be() | No description in source. |
utf32 | String utf32() | No description in source. |
ascii | String ascii() | No description in source. |
latin1 | String latin1() | No description in source. |
set | void set(String v) | ---- name management (in-language) --------------------------------- |
get | String get() | No description in source. |
clear | void clear() | No description in source. |
name | String name() | No description in source. |
equals | boolean equals(String other) | No description in source. |
canonical | String canonical(String n) | canonical(n): resolve common aliases to a canonical name (real, via ==). |
isUnicode | boolean isUnicode() | ---- classification (in-language) ---------------------------------- |
isSingleByte | boolean isSingleByte() | No description in source. |
isAsciiCompat | boolean isAsciiCompat() | No description in source. |
bridge | String bridge(String op) | ---- bridged transcoding (the real byte work) --------------------- |
bridgeArg | String bridgeArg(String op, String a) | No description in source. |
encode | String encode(String text) | No description in source. |
decode | String decode(String bytes) | No description in source. |
canEncode | String canEncode(String text) | No description in source. |
newEncoder | String newEncoder() | No description in source. |
newDecoder | String newDecoder() | No description in source. |
typeName | String typeName() | ---- introspection ------------------------------------------------- |
available | boolean available() | No description in source. |
copy | SLCharset copy() | SLCloneable / SLDisposable intent. |
dispose | void dispose() | No description in source. |
SLFormatter #sleela 2.5 (lib/text/SLFormatter.sleela)
SLFormatter class
SLFormatter -- a comprehensive text formatter for the text >
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
value | String value = "" | Last pattern set, for stateful callers; the helpers are also stateless. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
set | void set(String v) | No description in source. |
get | String get() | No description in source. |
clear | void clear() | No description in source. |
render1 | String render1(String a) | ---- in-language assembly (real) ---------------------------------- render1..render3: substitute {} placeholders left to right with args, built purely with +. The pattern is split on the literal "{}" marker. |
render2 | String render2(String a, String b) | No description in source. |
render3 | String render3(String a, String b, String c) | No description in source. |
fill | String fill(String pattern, String arg) | fill(pattern, arg): appends arg to pattern. Finding a "{}" marker inside a raw pattern is char-level work the language cannot do, so fill() is the honest append primitive render1..3 build on; for true positional templating use template() below (caller supplies the literal segments) or the bridged format(). |
template | String template(String[] segments, String[] args) | template(segments, args): REAL positional substitution, fully in-language. The caller supplies the literal pieces already split, so no char search is needed. The result interleaves segments and args: segments = ["Hello, ", "! You have ", " messages."] args = ["Max", "3"] -> "Hello, Max! You have 3 messages." Works for any counts: leftover segments are appended, missing args are treated as "". This is the dependable template engine for the text family. |
templateSep | String templateSep(String[] args, String sep) | templateSep(args, sep): join args with a separator and no literal frame -- a common special case of template(). Real. |
wrap | String wrap(String prefix, String body, String suffix) | prefixSuffix: the dependable in-language form -- caller supplies the parts. |
kv | String kv(String key, String val) | key/value line rendering (real). |
kvLine | String kvLine(String key, String val) | No description in source. |
field | String field(String key, String val, String sep) | No description in source. |
list | String list(String[] parts, String sep) | list(parts, sep): render a String[] separated by sep (real). |
bullets | String bullets(String[] parts) | bullets(parts): render a String[] as a dashed bullet block (real). |
numbered | String numbered(String[] parts) | numbered(parts): render a String[] as a 1-based numbered list (real). |
table2 | String table2(String[] keys, String[] vals) | table2(keys, vals): render two parallel String[] as aligned "key: val" lines (real). Uses the shorter of the two lengths. |
repeatChar | String repeatChar(String padChar, int count) | repeatChar(padChar, count): padChar repeated count times (real). The in-language padding primitive. count <= 0 yields "". |
pad | String pad(String s, int count, String padChar) | pad / padRight(s, count, padChar): append `count` pad units after s (real). Honest naming: this adds `count` units of padding (it cannot measure s to pad to an absolute column -- that is the bridged padTo()). |
padRight | String padRight(String s, int count, String padChar) | No description in source. |
padLeft | String padLeft(String s, int count, String padChar) | padLeft(s, count, padChar): prepend `count` pad units before s (real). |
indent | String indent(String block, String padChar, int count) | indent(block, padChar, count): prefix with `count` pad units (real). |
columnLeft | String columnLeft(String[] cells, int width, String padChar) | ---- real column alignment over a char-cell view ------------------- When the caller supplies the content as a String[] of glyph cells, we know its true character width (arrayLength), so we can align to an ABSOLUTE column fully in-language -- the exact-column case that the raw-String padLeft/padRight could not do and padTo() had to bridge. |
columnRight | String columnRight(String[] cells, int width, String padChar) | No description in source. |
columnCenter | String columnCenter(String[] cells, int width, String padChar) | No description in source. |
fromCells | String fromCells(String[] cells) | fromCells(cells): rejoin a char-cell array into a String (real). |
bridge | String bridge(String op, String a) | ---- bridged printf-style formatting ------------------------------ |
bridgeArg | String bridgeArg(String op, String a, String b) | No description in source. |
format | String format(String pattern, String args) | format(pattern, args): printf-style, needs spec parsing -> bridged. |
formatOne | String formatOne(String pattern, String a) | No description in source. |
padTo | String padTo(String s, String width) | No description in source. |
alignRight | String alignRight(String s, String width) | No description in source. |
typeName | String typeName() | ---- introspection ------------------------------------------------- |
available | boolean available() | No description in source. |
copy | SLFormatter copy() | SLCloneable / SLDisposable intent. |
dispose | void dispose() | No description in source. |
SLRegex #sleela 2.5 (lib/text/SLRegex.sleela)
SLRegex class
SLRegex -- a comprehensive regular-expression contract for the >
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
value | String value = "" | the pattern source |
flags | String flags = "" | e.g. "i", "m", "s", "ix" |
compiled | int compiled = 0 | 1 once the runtime has compiled it (via bridge) |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
set | void set(String v) | ---- pattern management (in-language) ------------------------------ |
get | String get() | No description in source. |
clear | void clear() | No description in source. |
setFlags | void setFlags(String f) | No description in source. |
getFlags | String getFlags() | No description in source. |
equals | boolean equals(String other) | No description in source. |
isEmpty | boolean isEmpty() | No description in source. |
anchored | String anchored() | Pattern assembly helpers (real, built with +): anchor / group / alternate. |
startAnchored | String startAnchored() | No description in source. |
endAnchored | String endAnchored() | No description in source. |
grouped | String grouped() | No description in source. |
optional | String optional() | No description in source. |
alternate | String alternate(String other) | No description in source. |
withFlags | String withFlags() | No description in source. |
bridge | String bridge(String op) | ---- bridged matching (the real engine) ---------------------------- |
bridgeArg | String bridgeArg(String op, String a) | No description in source. |
bridgeArg2 | String bridgeArg2(String op, String a, String b) | No description in source. |
compile | String compile() | No description in source. |
isCompiled | boolean isCompiled() | No description in source. |
matches | String matches(String input) | No description in source. |
find | String find(String input) | No description in source. |
findAll | String findAll(String input) | No description in source. |
group | String group(String input, String idx) | No description in source. |
groupCount | String groupCount() | No description in source. |
replaceAll | String replaceAll(String input, String to) | No description in source. |
replaceFirst | String replaceFirst(String input, String to) | No description in source. |
split | String split(String input) | No description in source. |
typeName | String typeName() | ---- introspection ------------------------------------------------- |
available | boolean available() | No description in source. |
copy | SLRegex copy() | SLCloneable / SLDisposable intent. |
dispose | void dispose() | No description in source. |
SLString #sleela 2.5 (lib/text/SLString.sleela)
SLString class
The comprehensive SLeeLa text/String contract (SLString) for the >
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
value | String value = "" | ---- backing value ------------------------------------------------- The text this SLString wraps. value == "" is the canonical empty state. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
id | int id() | ---- identity ------------------------------------------------------ |
name | String name() | No description in source. |
set | void set(String v) | ---- construction / lifecycle -------------------------------------- Library convention is an explicit initialiser rather than a constructor. |
get | String get() | No description in source. |
clear | void clear() | No description in source. |
with | SLString with(String v) | fluent seed |
copy | SLString copy() | SLCloneable intent: a detached copy of this SLString. |
dispose | void dispose() | SLDisposable intent: release to the canonical empty state. |
concat | String concat(String other) | Concatenation: the one native String operator besides compare. |
equals | boolean equals(String other) | Equality / emptiness via the native == on strings. |
isEmpty | boolean isEmpty() | No description in source. |
notEmpty | boolean notEmpty() | No description in source. |
isNull | boolean isNull() | Null/absence helpers (a SLeeLa String field may be unset == null). |
isBlankLike | boolean isBlankLike() | No description in source. |
append | SLString append(String tail) | Append/prepend mutate the wrapped value and return it fluently. |
prepend | SLString prepend(String head) | No description in source. |
appendLine | SLString appendLine(String tail) | No description in source. |
repeat | String repeat(int n) | repeat(n): value repeated n times (n <= 0 yields ""). Built with a loop over the native + operator -- fully in-language. |
join | String join(String[] parts, String sep) | join(parts, sep): join a String[] with a separator. In-language: loop + +. |
joinLines | String joinLines(String[] parts) | joinLines(parts): join a String[] with newlines. |
surround | String surround(String left, String right) | surround / quote: wrap the value with affixes (in-language). |
quote | String quote() | No description in source. |
parens | String parens() | No description in source. |
concatBoth | String concatBoth(String a, String b) | Static-style helpers: the same in-language operations as free functions over explicit arguments, for callers that do not wish to seed value first. |
equalsText | boolean equalsText(String a, String b) | No description in source. |
isEmptyText | boolean isEmptyText(String s) | No description in source. |
repeatText | String repeatText(String s, int n) | No description in source. |
repeatWithSep | String repeatWithSep(int n, String sep) | repeatWithSep(n, sep): the value repeated n times, separated by sep. e.g. value "ab", n 3, sep "," -> "ab,ab,ab". n <= 0 yields "". |
times | SLString times(int n) | times(n): fluent in-place repeat -- sets value to itself n times. |
defaultIfEmpty | String defaultIfEmpty(String fallback) | defaultIfEmpty / defaultIfBlank: fall back when unset/empty. Real: uses only == against "" and null. |
orElse | SLString orElse(String fallback) | No description in source. |
equalsAnyOf | boolean equalsAnyOf(String[] options) | equalsAnyOf(options): true if value equals any element of the array. Real: native == in a loop. |
equalsNoneOf | boolean equalsNoneOf(String[] options) | equalsNoneOf(options): the complement of equalsAnyOf. |
ensureExact | String ensureExact(String required) | ensurePrefix / ensureSuffix: add an affix only if not already fully equal to being the whole value (in-language: we can test whole-string equality, not substring, so this guards against double-wrapping an exact match). |
wrapEach | String[] wrapEach(String[] parts, String left, String right) | wrapEach(parts, left, right): wrap every element of a String[] and return a new String[] of the same length. Real: array alloc + loop + +. |
joinNonEmpty | String joinNonEmpty(String[] parts, String sep) | joinNonEmpty(parts, sep): join a String[] with sep, skipping null/"" parts. Real: == tests + loop. |
countParts | int countParts(String[] parts) | countParts(parts): number of non-null, non-empty elements in a String[]. |
lines | String lines(String[] parts) | lines(parts) / csv(parts): common joins as named conveniences. |
csv | String csv(String[] parts) | No description in source. |
spaced | String spaced(String[] parts) | No description in source. |
concatAll | String concatAll(String[] parts) | concatAll(parts): concatenate every element of a String[] with no separator (real: loop + +). The separator-less sibling of join. |
wrapIfNotEmpty | String wrapIfNotEmpty(String left, String right) | wrapIfNotEmpty(left, right): surround the value only when it is non-empty; an empty/unset value stays "" (real: == guard). Avoids emitting bare affixes. |
prefixIf | String prefixIf(boolean cond, String head) | prefixIf(cond, head) / suffixIf(cond, tail): conditionally affix the value and return the result (real). Handy when assembling text from flags. |
suffixIf | String suffixIf(boolean cond, String tail) | No description in source. |
fromCells | String fromCells(String[] cells) | fromCells(cells): rejoin a char-cell array into a String (real). |
lengthCells | int lengthCells(String[] cells) | lengthCells(cells): real character length of a char-cell view. |
charAtCells | String charAtCells(String[] cells, int i) | charAtCells(cells, i): the glyph at index i, or "" if out of range (real). |
substringCells | String substringCells(String[] cells, int from, int to) | substringCells(cells, from, to): the cells in [from, to) rejoined (real). from is clamped to 0, to is clamped to the length; from >= to yields "". |
indexOfCell | int indexOfCell(String[] cells, String needle) | indexOfCell(cells, needle): first index whose cell == needle, else -1 (real). |
lastIndexOfCell | int lastIndexOfCell(String[] cells, String needle) | lastIndexOfCell(cells, needle): last matching index, else -1 (real). |
containsCell | boolean containsCell(String[] cells, String needle) | containsCell(cells, needle): true if any cell equals needle (real). |
countCell | int countCell(String[] cells, String needle) | countCell(cells, needle): how many cells equal needle (real). |
startsWithCells | boolean startsWithCells(String[] cells, String[] prefix) | startsWithCells(cells, prefix): does the cell view begin with the prefix cell array? Real: element-wise == over the leading cells. |
endsWithCells | boolean endsWithCells(String[] cells, String[] suffix) | endsWithCells(cells, suffix): does the cell view end with the suffix cells? |
reverseCells | String reverseCells(String[] cells) | reverseCells(cells): the glyphs in reverse order, rejoined (real). |
replaceCells | String[] replaceCells(String[] cells, String from, String to) | replaceCells(cells, from, to): every cell equal to `from` becomes `to`; returns a new String[] of the same length (real). |
equalsCells | boolean equalsCells(String[] a, String[] b) | equalsCells(a, b): element-wise equality of two char-cell views (real). |
padCellsLeft | String padCellsLeft(String[] cells, int width, String padCell) | padCellsLeft / padCellsRight(cells, width, padCell): pad the view to a real target character width with padCell, returning a String (real). If the view is already >= width, it is returned rejoined unchanged. |
padCellsRight | String padCellsRight(String[] cells, int width, String padCell) | No description in source. |
padCenterCells | String padCenterCells(String[] cells, int width, String padCell) | padCenterCells(cells, width, padCell): centre the view in a real character width, padding both sides with padCell. Any odd remainder goes on the right (matching common centre-text conventions). If the view is already >= width, it is returned rejoined unchanged. Fully in-language (loops + +). |
truncateCells | String truncateCells(String[] cells, int width, String ellipsisCell) | truncateCells(cells, width, ellipsisCell): if the view is longer than width real characters, keep the first (width - 1) cells and append ellipsisCell so the result is exactly `width` cells wide; otherwise return it unchanged. A width <= 0 yields "". Real: slice + append over the supplied cells. |
sliceCells | String[] sliceCells(String[] cells, int from, int to) | sliceCells(cells, from, to): the cells in [from, to) as a NEW String[] (real). from is clamped to 0, to to the length; from >= to yields an empty array. This is the array-returning sibling of substringCells (which rejoins). |
insertCells | String[] insertCells(String[] cells, int at, String[] ins) | insertCells(cells, at, ins): a NEW cell array with the cells of `ins` spliced in before index `at` (at clamped to [0, len]). Real: array alloc + copy loops. |
deleteCellsRange | String[] deleteCellsRange(String[] cells, int from, int to) | deleteCellsRange(cells, from, to): a NEW cell array with [from, to) removed (from clamped to 0, to to the length; from >= to removes nothing). Real. |
matchesAt | boolean matchesAt(String[] cells, int at, String[] needle) | matchesAt(cells, at, needle): does the needle cell-sequence occur in `cells` starting exactly at index `at`? Real: element-wise == over the window. |
indexOfSeqCells | int indexOfSeqCells(String[] cells, String[] needle) | indexOfSeqCells(cells, needle): first start index where the needle sequence occurs, or -1. An empty needle matches at 0 (as substring search does). Real. |
lastIndexOfSeqCells | int lastIndexOfSeqCells(String[] cells, String[] needle) | lastIndexOfSeqCells(cells, needle): last start index of the needle sequence, or -1. Empty needle matches at the end. Real. |
containsSeqCells | boolean containsSeqCells(String[] cells, String[] needle) | containsSeqCells / startsWithSeqCells / endsWithSeqCells: multi-cell forms of the single-cell predicates, built on matchesAt / indexOfSeqCells (real). |
startsWithSeqCells | boolean startsWithSeqCells(String[] cells, String[] needle) | No description in source. |
endsWithSeqCells | boolean endsWithSeqCells(String[] cells, String[] needle) | No description in source. |
countSeqCells | int countSeqCells(String[] cells, String[] needle) | countSeqCells(cells, needle): number of NON-OVERLAPPING occurrences of the needle sequence. An empty needle yields 0 (no progress possible). Real. |
replaceSeqCells | String replaceSeqCells(String[] cells, String[] from, String[] to) | replaceSeqCells(cells, from, to): replace every NON-OVERLAPPING occurrence of the `from` cell-sequence with the `to` cell-sequence, returning the rejoined String. An empty `from` returns the view unchanged. Real: scan + rebuild. |
splitCellsOn | String[] splitCellsOn(String[] cells, String sepCell) | splitCellsOn(cells, sepCell): split the view on each cell equal to sepCell, returning the segments as a NEW String[] (each segment is the rejoined run of cells between separators; adjacent separators yield "" segments). Real. |
mapCell | String mapCell(String cell, String[] fromSet, String[] toSet) | mapCell(cell, fromSet, toSet): the mapped cell if `cell` equals some fromSet[k] (first match wins), else `cell` unchanged. Real. |
mapCells | String[] mapCells(String[] cells, String[] fromSet, String[] toSet) | mapCells(cells, fromSet, toSet): translate every cell through the pair table and return a NEW String[] of the same length (real). |
mapCellsToString | String mapCellsToString(String[] cells, String[] fromSet, String[] toSet) | mapCellsToString(cells, fromSet, toSet): as mapCells, rejoined to a String. |
trimCells | String trimCells(String[] cells, String blankCell) | trimCells(cells, blankCell): drop leading and trailing cells equal to blankCell, returning the rejoined inner String (real). All-blank -> "". |
bridge | String bridge(String op) | Descriptor builders. |
bridgeArg | String bridgeArg(String op, String a) | No description in source. |
bridgeArg2 | String bridgeArg2(String op, String a, String b) | No description in source. |
bridgeOp | String bridgeOp(String[] fields) | bridgeOp(fields): read the op name back out of a descriptor that has been split on ":" into fields (field 0 == "text.bridge", field 1 == the op). Real: a caller that split the descriptor (e.g. via the bridged split()) can reason about it fully in-language. Returns "" if the array is malformed. |
isBridgeDescriptor | boolean isBridgeDescriptor(String[] fields) | isBridgeDescriptor(fields): true if the split fields name a text.bridge descriptor for a known op (real; composes bridgeOp + isBridged). |
isBridged | boolean isBridged(String op) | Descriptor introspection: does this string name a bridged op, and which? |
bridgeKind | String bridgeKind(String op) | bridgeKind(op): "int" / "boolean" / "string" / "string[]" -- the TYPE the runtime yields for a bridged op, so a caller knows how to read the result even though the descriptor itself is carried as a String. |
length | String length() | Length / indexing -- bridged (no in-language char access). length() returns the descriptor; lengthValue() signals the int-typed form. |
lengthValue | String lengthValue() | No description in source. |
charAt | String charAt(String idx) | No description in source. |
codePointAt | String codePointAt(String idx) | No description in source. |
chars | String chars() | No description in source. |
substring | String substring(String from, String to) | Slicing / search -- bridged. |
indexOf | String indexOf(String needle) | No description in source. |
lastIndexOf | String lastIndexOf(String needle) | No description in source. |
contains | String contains(String needle) | No description in source. |
startsWith | String startsWith(String prefix) | No description in source. |
endsWith | String endsWith(String suffix) | No description in source. |
codePoints | String codePoints() | Length / indexing (continued) -- bridged. |
toUpperCase | String toUpperCase() | Transformation -- bridged. |
toLowerCase | String toLowerCase() | No description in source. |
trim | String trim() | No description in source. |
strip | String strip() | No description in source. |
stripLeading | String stripLeading() | strip only the leading / trailing run of Unicode whitespace -- char-level, so bridged (the in-language trimCells covers the explicit char-cell case). |
stripTrailing | String stripTrailing() | No description in source. |
normalize | String normalize(String form) | Unicode normalization (NFC/NFD/NFKC/NFKD named by `form`) -- bridged. |
replace | String replace(String from, String to) | No description in source. |
replaceAll | String replaceAll(String regex, String to) | No description in source. |
replaceFirst | String replaceFirst(String regex, String to) | replaceFirst: replace only the first regex match -- bridged. |
split | String split(String regex) | Splitting / matching / ordering / hashing -- bridged. |
matches | String matches(String regex) | No description in source. |
compareTo | String compareTo(String other) | No description in source. |
compareToIgnoreCase | String compareToIgnoreCase(String other) | No description in source. |
equalsIgnoreCase | String equalsIgnoreCase(String other) | No description in source. |
hashCode | String hashCode() | No description in source. |
format | String format(String pattern) | Formatting -- bridged (format uses the native formatter over the bridge). |
formatWith | String formatWith(String pattern, String arg) | formatWith(pattern, arg): single-argument printf-style format -- bridged. |
typeName | String typeName() | ---- introspection ------------------------------------------------- |
available | boolean available() | No description in source. |
SLStringBuffer #sleela 2.5 (lib/text/SLStringBuffer.sleela)
SLStringBuffer class
SLStringBuffer -- the synchronized mutable text buffer for the >
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
value | String value = "" | No description in source. |
edits | int edits = 0 | number of mutations |
locks | int locks = 0 | depth of synchronized sections entered |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
beginSync | String beginSync() | ---- synchronization (bridged runtime concern) -------------------- The native runtime supplies the real monitor; these mark the boundary and keep an honest in-language view of lock depth for diagnostics. (Named beginSync/endSync rather than lock/unlock: lock is a reserved built-in.) |
endSync | String endSync() | No description in source. |
isLocked | boolean isLocked() | No description in source. |
lockDepth | int lockDepth() | No description in source. |
clear | void clear() | ---- lifecycle ----------------------------------------------------- |
isEmpty | boolean isEmpty() | No description in source. |
notEmpty | boolean notEmpty() | No description in source. |
editCount | int editCount() | No description in source. |
append | SLStringBuffer append(String s) | ---- in-language appends (guarded; fluent) ------------------------ |
appendInt | SLStringBuffer appendInt(int n) | No description in source. |
appendBool | SLStringBuffer appendBool(boolean b) | No description in source. |
appendLine | SLStringBuffer appendLine(String s) | No description in source. |
prepend | SLStringBuffer prepend(String s) | No description in source. |
repeat | SLStringBuffer repeat(String s, int n) | No description in source. |
appendIf | SLStringBuffer appendIf(boolean cond, String s) | appendIf(cond, s): guarded conditional append (real, fluent). |
join | SLStringBuffer join(String[] parts, String sep) | No description in source. |
toString | String toString() | ---- result -------------------------------------------------------- |
get | String get() | No description in source. |
set | void set(String v) | No description in source. |
bridge | String bridge(String op) | ---- bridged char-level operations --------------------------------- |
bridgeArg | String bridgeArg(String op, String a) | No description in source. |
bridgeArg2 | String bridgeArg2(String op, String a, String b) | No description in source. |
charAt | String charAt(String idx) | No description in source. |
substring | String substring(String from, String to) | No description in source. |
insertAt | String insertAt(String idx, String s) | No description in source. |
deleteRange | String deleteRange(String from, String to) | No description in source. |
reverse | String reverse() | No description in source. |
indexOf | String indexOf(String needle) | No description in source. |
typeName | String typeName() | ---- introspection ------------------------------------------------- |
available | boolean available() | No description in source. |
copy | SLStringBuffer copy() | SLCloneable / SLDisposable intent. |
dispose | void dispose() | No description in source. |
SLStringBuilder #sleela 2.5 (lib/text/SLStringBuilder.sleela)
SLStringBuilder class
SLStringBuilder -- a comprehensive mutable text builder for the >
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
value | String value = "" | Accumulated text. |
segments | int segments = 0 | number of segments appended through this builder (real, in-language count). NOT the character length -- character length is char-level and bridged via length()/lengthValue(). |
edits | int edits = 0 | number of mutations (append/insert/clear...) |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
clear | void clear() | ---- lifecycle ----------------------------------------------------- |
isEmpty | boolean isEmpty() | No description in source. |
notEmpty | boolean notEmpty() | No description in source. |
segmentCount | int segmentCount() | real, in-language: how many segments have been appended. |
editCount | int editCount() | No description in source. |
length | String length() | character length is char-level -> bridged, returned as an honest descriptor. |
lengthValue | String lengthValue() | No description in source. |
append | SLStringBuilder append(String s) | ---- in-language appends (return this for fluent chaining) --------- |
appendInt | SLStringBuilder appendInt(int n) | No description in source. |
appendBool | SLStringBuilder appendBool(boolean b) | No description in source. |
appendLine | SLStringBuilder appendLine(String s) | No description in source. |
newline | SLStringBuilder newline() | No description in source. |
prepend | SLStringBuilder prepend(String s) | No description in source. |
space | SLStringBuilder space() | No description in source. |
appendIf | SLStringBuilder appendIf(boolean cond, String s) | appendIf(cond, s): append only when cond is true (real, fluent). |
appendJoined | SLStringBuilder appendJoined(String[] parts, String sep) | appendJoined(parts, sep): append a String[] joined by sep as one segment. |
repeat | SLStringBuilder repeat(String s, int n) | repeat(s, n): append s n times (n <= 0 is a no-op). |
join | SLStringBuilder join(String[] parts, String sep) | join(parts, sep): append a String[] joined by sep. |
appendAll | SLStringBuilder appendAll(String[] parts) | appendAll(parts): append every element of a String[]. |
toString | String toString() | ---- result -------------------------------------------------------- |
get | String get() | No description in source. |
set | void set(String v) | No description in source. |
appendCells | SLStringBuilder appendCells(String[] cells) | ---- char-cell view (REAL char-level ops over an explicit String[]) ----- When the caller supplies the glyphs as a String[] of single cells, these are genuinely in-language -- no bridge, no faking. appendCells builds the value from cells; reverseCells/charAtCells operate on a supplied view. |
reverseCells | String reverseCells(String[] cells) | reverseCells(cells): the glyphs reversed and rejoined (real). |
charAtCells | String charAtCells(String[] cells, int i) | charAtCells(cells, i): glyph at i, or "" if out of range (real). |
lengthCells | int lengthCells(String[] cells) | lengthCells(cells): real character length of a char-cell view. |
bridge | String bridge(String op) | ---- bridged char-level operations --------------------------------- Need the raw code units; cross the VM/OS bridge with an honest descriptor. |
bridgeArg | String bridgeArg(String op, String a) | No description in source. |
bridgeArg2 | String bridgeArg2(String op, String a, String b) | No description in source. |
charLength | String charLength(String s) | charLength(s): the exact character length of a string is char-level, so it is bridged and returned as an honest descriptor -- never a faked integer. |
charAt | String charAt(String idx) | No description in source. |
substring | String substring(String from, String to) | No description in source. |
insertAt | String insertAt(String idx, String s) | No description in source. |
deleteRange | String deleteRange(String from, String to) | No description in source. |
reverse | String reverse() | No description in source. |
indexOf | String indexOf(String needle) | No description in source. |
typeName | String typeName() | ---- introspection ------------------------------------------------- |
available | boolean available() | No description in source. |
copy | SLStringBuilder copy() | SLCloneable / SLDisposable intent. |
dispose | void dispose() | No description in source. |
SLStringCells #sleela 2.5 (lib/text/SLStringCells.sleela)
SLStringCells class
SLStringCells -- a pure, static-style companion to SLString that >
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
id | int id() | ---- identity ------------------------------------------------------ |
name | String name() | No description in source. |
typeName | String typeName() | No description in source. |
available | boolean available() | No description in source. |
joinCells | String joinCells(String[] cells) | joinCells(cells): rejoin a char-cell array into a String (real). |
joinWith | String joinWith(String[] cells, String sep) | joinWith(cells, sep): rejoin with a separator between cells (real). |
copyCells | String[] copyCells(String[] cells) | copyCells(cells): a detached copy of the cell array (real). |
repeatCells | String[] repeatCells(String[] cells, int n) | repeatCells(cells, n): a NEW cell array with the view repeated n times (n <= 0 yields an empty array). Real: array alloc + copy loops. |
concatCells | String[] concatCells(String[] a, String[] b) | concatCells(a, b): a NEW cell array that is a followed by b (real). |
length | int length(String[] cells) | No description in source. |
isEmpty | boolean isEmpty(String[] cells) | No description in source. |
at | String at(String[] cells, int i) | at(cells, i): the glyph at index i, or "" if out of range (real). |
first | String first(String[] cells) | first / last: the end glyphs, or "" when empty (real). |
last | String last(String[] cells) | No description in source. |
slice | String[] slice(String[] cells, int from, int to) | slice(cells, from, to): the cells in [from, to) as a NEW array; from clamped to 0, to to the length; from >= to yields an empty array (real). |
substring | String substring(String[] cells, int from, int to) | substring(cells, from, to): slice(...) rejoined to a String (real). |
reverse | String[] reverse(String[] cells) | reverse(cells): a NEW cell array in reverse order (real). |
reverseString | String reverseString(String[] cells) | reverseString(cells): the glyphs reversed and rejoined (real). |
indexOf | int indexOf(String[] cells, String needle) | No description in source. |
lastIndexOf | int lastIndexOf(String[] cells, String needle) | No description in source. |
contains | boolean contains(String[] cells, String needle) | No description in source. |
count | int count(String[] cells, String needle) | No description in source. |
matchesAt | boolean matchesAt(String[] cells, int at, String[] needle) | matchesAt(cells, at, needle): does needle occur starting exactly at `at`? |
indexOfSeq | int indexOfSeq(String[] cells, String[] needle) | indexOfSeq(cells, needle): first start index of needle, or -1 (empty needle matches at 0). lastIndexOfSeq is the right-to-left form. |
lastIndexOfSeq | int lastIndexOfSeq(String[] cells, String[] needle) | No description in source. |
containsSeq | boolean containsSeq(String[] cells, String[] needle) | No description in source. |
startsWith | boolean startsWith(String[] cells, String[] needle) | No description in source. |
endsWith | boolean endsWith(String[] cells, String[] needle) | No description in source. |
countSeq | int countSeq(String[] cells, String[] needle) | countSeq(cells, needle): non-overlapping occurrences (empty needle -> 0). |
replaceSeq | String replaceSeq(String[] cells, String[] from, String[] to) | replaceSeq(cells, from, to): every non-overlapping `from` becomes `to`, rejoined to a String (empty `from` returns the view unchanged). Real. |
replaceCell | String[] replaceCell(String[] cells, String from, String to) | replaceCell(cells, from, to): every cell == from becomes to; a NEW array of the same length (real). |
insert | String[] insert(String[] cells, int at, String[] ins) | No description in source. |
deleteRange | String[] deleteRange(String[] cells, int from, int to) | No description in source. |
splitOn | String[] splitOn(String[] cells, String sepCell) | splitOn(cells, sepCell): split on each cell == sepCell; the segments as a NEW String[] (adjacent separators yield "" segments). Real. |
fieldCount | int fieldCount(String[] cells, String sepCell) | fieldCount(cells, sepCell): number of fields splitOn would produce (real). |
mapCell | String mapCell(String cell, String[] fromSet, String[] toSet) | mapCell(cell, fromSet, toSet): the mapped cell if cell == fromSet[k] (first match wins), else the cell unchanged (real). |
map | String[] map(String[] cells, String[] fromSet, String[] toSet) | map(cells, fromSet, toSet): translate every cell; a NEW array (real). |
mapToString | String mapToString(String[] cells, String[] fromSet, String[] toSet) | mapToString(cells, fromSet, toSet): map(...) rejoined to a String (real). |
isBlankCell | boolean isBlankCell(String cell, String[] blanks) | isBlankCell(cell, blanks): true if the cell equals any blank in the set. |
trim | String trim(String[] cells, String[] blanks) | trim(cells, blanks): drop leading + trailing cells in the blank set, rejoined. |
isBlank | boolean isBlank(String[] cells, String[] blanks) | isBlank(cells, blanks): true if the view is empty or all blank cells (real). |
padLeft | String padLeft(String[] cells, int width, String padCell) | No description in source. |
padRight | String padRight(String[] cells, int width, String padCell) | No description in source. |
padCenter | String padCenter(String[] cells, int width, String padCell) | No description in source. |
truncate | String truncate(String[] cells, int width, String ellipsisCell) | truncate(cells, width, ellipsisCell): keep first (width-1) cells + ellipsis when longer than width, so the result is exactly `width` cells; width <= 0 yields "" (real). |
equals | boolean equals(String[] a, String[] b) | equals(a, b): element-wise equality of two cell views (real). |
commonPrefixLength | int commonPrefixLength(String[] a, String[] b) | commonPrefixLength(a, b): number of leading cells a and b share (real). |
asciiCells | String[] asciiCells() | asciiCells(): the 95 printable ASCII glyphs (space..~) as a cell array. The index of a cell is its ASCII code minus 32, so this doubles as a code table. |
asciiCode | int asciiCode(String cell) | asciiCode(cell): the ASCII code (32..126) of a single printable cell, or -1 if it is not a known printable ASCII glyph (real: lookup in asciiCells). |
asciiUpperSet | String[] asciiUpperSet() | asciiUpper / asciiLower pair tables (26 letters) -- the explicit case table the case-mapping helpers expect, built in-language from asciiCells(). asciiUpperSet: the 26 upper-case letters A..Z (ascii index 33..58). |
asciiLowerSet | String[] asciiLowerSet() | asciiLowerSet: the 26 lower-case letters a..z (ascii index 65..90). |
toUpperAscii | String toUpperAscii(String[] cells) | toUpperAscii / toLowerAscii(cells): case-fold ASCII letters via the ascii pair tables; non-letters pass through unchanged. REAL and honest -- the map is the explicit ASCII case table, nothing about arbitrary Unicode assumed. |
toLowerAscii | String toLowerAscii(String[] cells) | No description in source. |
SLTextReader #sleela 2.5 (lib/text/SLTextReader.sleela)
SLTextReader class
SLTextReader -- a comprehensive buffered text-input contract for >
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
value | String value = "" | the source name/path or primed buffer content |
charset | String charset = "UTF-8" | decoding charset |
buffer | String buffer = "" | in-memory lookahead buffer (in-language) |
line | int line = 1 | 1-based current line |
offset | int offset = 0 | characters consumed |
atEof | int atEof = 0 | 1 once the source is exhausted |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
set | void set(String v) | ---- configuration / lifecycle (in-language) ---------------------- |
get | String get() | No description in source. |
clear | void clear() | No description in source. |
setCharset | void setCharset(String c) | No description in source. |
getCharset | String getCharset() | No description in source. |
prime | void prime(String text) | In-memory buffer the caller can prime (useful for tests / piping). |
peekBuffer | String peekBuffer() | No description in source. |
hasBuffered | boolean hasBuffered() | No description in source. |
dropBuffer | void dropBuffer() | No description in source. |
lineNumber | int lineNumber() | Position state (in-language). |
position | int position() | No description in source. |
isEof | boolean isEof() | No description in source. |
markEof | void markEof() | No description in source. |
countLine | void countLine() | No description in source. |
advance | void advance(int chars) | No description in source. |
bridge | String bridge(String op) | ---- bridged source access (the real I/O) ------------------------- |
bridgeArg | String bridgeArg(String op, String a) | No description in source. |
open | String open() | No description in source. |
read | String read(String count) | No description in source. |
readChar | String readChar() | No description in source. |
readLine | String readLine() | No description in source. |
readAll | String readAll() | No description in source. |
ready | String ready() | No description in source. |
closeStream | String closeStream() | not named close(): close is reserved |
typeName | String typeName() | ---- introspection ------------------------------------------------- |
available | boolean available() | No description in source. |
copy | SLTextReader copy() | SLCloneable / SLDisposable intent. |
dispose | void dispose() | No description in source. |
SLTextWriter #sleela 2.5 (lib/text/SLTextWriter.sleela)
SLTextWriter class
SLTextWriter -- a comprehensive buffered text-output contract for >
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
value | String value = "" | the sink name/path |
charset | String charset = "UTF-8" | encoding charset |
pending | String pending = "" | accumulated, not-yet-flushed text (in-language) |
lines | int lines = 0 | lines written into the buffer |
edits | int edits = 0 | number of write operations |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
set | void set(String v) | ---- configuration / lifecycle (in-language) ---------------------- |
get | String get() | No description in source. |
clear | void clear() | No description in source. |
setCharset | void setCharset(String c) | No description in source. |
getCharset | String getCharset() | No description in source. |
write | SLTextWriter write(String s) | ---- in-language buffered writes (real; fluent) ------------------- |
writeInt | SLTextWriter writeInt(int n) | No description in source. |
writeLine | SLTextWriter writeLine(String s) | No description in source. |
newline | SLTextWriter newline() | No description in source. |
space | SLTextWriter space() | No description in source. |
indent | SLTextWriter indent(int depth) | indent(depth): write depth units of two-space indentation (real). |
writeAll | SLTextWriter writeAll(String[] parts) | writeAll(parts): write every element of a String[] (real). |
buffered | String buffered() | pending-content inspection (in-language). |
hasPending | boolean hasPending() | No description in source. |
lineCount | int lineCount() | No description in source. |
writeCount | int writeCount() | No description in source. |
bridge | String bridge(String op) | ---- bridged sink access (the real I/O) --------------------------- |
bridgeArg | String bridgeArg(String op, String a) | No description in source. |
open | String open() | No description in source. |
flush | String flush() | flush(): hand the pending buffer to the runtime sink and clear it locally. |
drain | String drain() | No description in source. |
closeStream | String closeStream() | not named close(): close is reserved |
typeName | String typeName() | ---- introspection ------------------------------------------------- |
available | boolean available() | No description in source. |
copy | SLTextWriter copy() | SLCloneable / SLDisposable intent. |
dispose | void dispose() | No description in source. |
string-cells-demo #sleela 2.5 (lib/text/string-cells-demo.sleela)
SLStringCells class
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
joinCells | String joinCells(String[] cells) | No description in source. |
slice | String[] slice(String[] cells, int from, int to) | No description in source. |
matchesAt | boolean matchesAt(String[] cells, int at, String[] needle) | No description in source. |
indexOfSeq | int indexOfSeq(String[] cells, String[] needle) | No description in source. |
containsSeq | boolean containsSeq(String[] cells, String[] needle) | No description in source. |
countSeq | int countSeq(String[] cells, String[] needle) | No description in source. |
replaceSeq | String replaceSeq(String[] cells, String[] from, String[] to) | No description in source. |
splitOn | String[] splitOn(String[] cells, String sepCell) | No description in source. |
mapCell | String mapCell(String cell, String[] fromSet, String[] toSet) | No description in source. |
map | String[] map(String[] cells, String[] fromSet, String[] toSet) | No description in source. |
mapToString | String mapToString(String[] cells, String[] fromSet, String[] toSet) | No description in source. |
isBlankCell | boolean isBlankCell(String cell, String[] blanks) | No description in source. |
trim | String trim(String[] cells, String[] blanks) | No description in source. |
padCenter | String padCenter(String[] cells, int width, String padCell) | No description in source. |
truncate | String truncate(String[] cells, int width, String ellipsisCell) | No description in source. |
main | void main() | No description in source. |
text-string-demo #sleela 2.5 (lib/text/text-string-demo.sleela)
SLString class
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
value | String value = "" | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
set | void set(String v) | No description in source. |
get | String get() | No description in source. |
with | SLString with(String v) | No description in source. |
copy | SLString copy() | No description in source. |
dispose | void dispose() | No description in source. |
concat | String concat(String other) | No description in source. |
equals | boolean equals(String other) | No description in source. |
isEmpty | boolean isEmpty() | No description in source. |
append | SLString append(String tail) | No description in source. |
prepend | SLString prepend(String head) | No description in source. |
repeat | String repeat(int n) | No description in source. |
join | String join(String[] parts, String sep) | No description in source. |
quote | String quote() | No description in source. |
repeatWithSep | String repeatWithSep(int n, String sep) | Richer in-language helpers (real; mirror lib/text/SLString). |
joinNonEmpty | String joinNonEmpty(String[] parts, String sep) | No description in source. |
equalsAnyOf | boolean equalsAnyOf(String[] options) | No description in source. |
fromCells | String fromCells(String[] cells) | Char-cell view: REAL char-level ops over an explicit String[] of glyphs. |
lengthCells | int lengthCells(String[] cells) | No description in source. |
charAtCells | String charAtCells(String[] cells, int i) | No description in source. |
substringCells | String substringCells(String[] cells, int from, int to) | No description in source. |
indexOfCell | int indexOfCell(String[] cells, String needle) | No description in source. |
reverseCells | String reverseCells(String[] cells) | No description in source. |
columnRight | String columnRight(String[] cells, int width, String padChar) | No description in source. |
padCenterCells | String padCenterCells(String[] cells, int width, String padCell) | New real char-cell helpers (mirror lib/text/SLString v1.1). |
truncateCells | String truncateCells(String[] cells, int width, String ellipsisCell) | No description in source. |
matchesAt | boolean matchesAt(String[] cells, int at, String[] needle) | No description in source. |
indexOfSeqCells | int indexOfSeqCells(String[] cells, String[] needle) | No description in source. |
countSeqCells | int countSeqCells(String[] cells, String[] needle) | No description in source. |
replaceSeqCells | String replaceSeqCells(String[] cells, String[] from, String[] to) | No description in source. |
mapCell | String mapCell(String cv, String[] fromSet, String[] toSet) | No description in source. |
mapCellsToString | String mapCellsToString(String[] cells, String[] fromSet, String[] toSet) | No description in source. |
splitCellsOn | String[] splitCellsOn(String[] cells, String sepCell) | No description in source. |
suffixIf | String suffixIf(boolean cond, String tail) | New pure value helpers + honest bridged declarations. |
wrapIfNotEmpty | String wrapIfNotEmpty(String left, String right) | No description in source. |
normalize | String normalize(String form) | No description in source. |
stripLeading | String stripLeading() | No description in source. |
bridge | String bridge(String op) | Bridged char-level ops -- honest descriptors, never faked. |
bridgeArg | String bridgeArg(String op, String a) | No description in source. |
bridgeKind | String bridgeKind(String op) | No description in source. |
length | String length() | No description in source. |
toUpperCase | String toUpperCase() | No description in source. |
indexOf | String indexOf(String needle) | No description in source. |
split | String split(String regex) | No description in source. |
main | void main() | No description in source. |