public static final class StringPart.Part
extends java.lang.Object
implements java.lang.CharSequence
StringPart.content.
toString() if the text should be persistently stored.
Using of the Part instance immediately helps safe calculation time and storage because it does not need allocated memory. It is a cheap operation only with some indices.
The content of a Part will become non accessible if the StringPart.content was shifted out especially by invocation of StringPartFromFileLines.readnextContentFromFile(int).
It means a Part instance should only be immediately used if the position is near the current StringPart.begin position.
The StringPartFromFileLines.readnextContentFromFile(int) let 1/3 of the StringPart.content accessible.| Modifier and Type | Field and Description |
|---|---|
private int |
absPos0
Absolute positions of part of chars
|
private int |
b1
Absolute positions of part of chars
|
private int |
e1
Absolute positions of part of chars
|
private StringPart |
outer |
| Modifier | Constructor and Description |
|---|---|
protected |
Part(StringPart outer,
int from,
int to)
A subsequence
|
| Modifier and Type | Method and Description |
|---|---|
char |
charAt(int index) |
(package private) int |
copyToBuffer(char[] dst,
int from,
int to)
Copy to any other buffer to build persistent data.
|
boolean |
equals(java.lang.Object cmp) |
int |
length() |
protected void |
setPart(int from,
int to) |
java.lang.CharSequence |
subSequence(int from,
int end) |
java.lang.String |
toString() |
StringPart.Part |
trim()
Builds a new Part without leading and trailing white spaces.
|
private int b1
private int e1
private int absPos0
private final StringPart outer
protected Part(StringPart outer, int from, int to)
from - absolute positionsto - protected void setPart(int from,
int to)
public final char charAt(int index)
charAt in interface java.lang.CharSequencepublic final int length()
length in interface java.lang.CharSequencepublic final boolean equals(java.lang.Object cmp)
equals in class java.lang.Objectpublic final java.lang.CharSequence subSequence(int from,
int end)
subSequence in interface java.lang.CharSequencepublic final java.lang.String toString()
toString in interface java.lang.CharSequencetoString in class java.lang.Objectint copyToBuffer(char[] dst,
int from,
int to)
dst - should be allocated with enough space, use this.length() to detect how much is necessary.from - usual 0public final StringPart.Part trim()