Package snap.text
Class CharBlock
java.lang.Object
snap.props.PropObject
snap.text.CharBlock
- All Implemented Interfaces:
CharSequence
,PropChange.DoChange
,CharSequenceX
This class manages a list of char lines.
-
Field Summary
Fields inherited from class snap.props.PropObject
_pcs, EMPTY_OBJECT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Adds a block at given index.char
charAt
(int charIndex) Override to get char from line at char index.protected CharLine
Creates a new CharLine for use in this text.Returns the last line.getLine
(int anIndex) Return individual line at given index.int
Return number of lines.getLineForCharIndex
(int charIndex) Returns the block at the given char index.int
length()
Override to return length.protected void
removeLine
(int anIndex) Removes the block at given index.subSequence
(int startCharIndex, int endCharIndex) Override to get subsequence from lines.protected void
updateLine
(CharLine textLine, int newIndex, int newStartCharIndex) Updates an individual line for new index and start char index.protected void
updateLines
(int anIndex) Updates Lines from index line to text end to account for changed line.Methods inherited from class snap.props.PropObject
addDeepChangeListener, addPropChangeListener, addPropChangeListener, clone, firePropChange, firePropChange, firePropChange, getPropDefault, getPropForName, getPropParent, getPropSet, getPropsForArchival, getPropsForArchivalExtra, getPropsString, getPropValue, initProps, isPropDefault, processPropChange, removeDeepChangeListener, removePropChangeListener, removePropChangeListener, setPropsString, setPropValue, setPropValues, toString, toStringProps
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty, toString
Methods inherited from interface snap.util.CharSequenceX
getIndentLength, getIndentString, getLastChar, indexAfterNewline, indexAfterNewlineOrEnd, indexOfNewline, isAfterLineEnd, isLastCharNewline, isLineEnd, isLineEndChar, isWhiteSpace, lastIndexAfterNewline, lastIndexOfNewline, startsWith
-
Constructor Details
-
CharBlock
public CharBlock()Constructor.
-
-
Method Details
-
getLineCount
public int getLineCount()Return number of lines. -
getLine
Return individual line at given index. -
createLine
Creates a new CharLine for use in this text. -
addLine
Adds a block at given index. -
removeLine
protected void removeLine(int anIndex) Removes the block at given index. -
updateLines
protected void updateLines(int anIndex) Updates Lines from index line to text end to account for changed line. -
updateLine
Updates an individual line for new index and start char index. -
getLastLine
Returns the last line. -
getLineForCharIndex
Returns the block at the given char index. -
length
public int length()Override to return length.- Specified by:
length
in interfaceCharSequence
-
charAt
public char charAt(int charIndex) Override to get char from line at char index.- Specified by:
charAt
in interfaceCharSequence
-
subSequence
Override to get subsequence from lines.- Specified by:
subSequence
in interfaceCharSequence
-