Package snap.text
Class CharLine
java.lang.Object
snap.text.CharLine
- All Implemented Interfaces:
CharSequence
,CharSequenceX
This class represents a line of chars in a CharBlock.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addChars
(CharSequence theChars, int anIndex) Adds characters to this line at given index.char
charAt
(int charIndex) Override to return char at given index in line.Returns the source text.int
Returns the end char index in source CharLines.int
Returns the index of this linegetNext()
Returns the next line.int
Returns the start char index in source CharLines.int
length()
Override to return number of chars in line.void
removeChars
(int aStart, int anEnd) Removes characters in given range.subSequence
(int startCharIndex, int endCharIndex) Override to return subSequence of char range in line.protected void
Updates text.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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
-
Field Details
-
_charBlock
-
_index
protected int _index -
_startCharIndex
protected int _startCharIndex
-
-
Constructor Details
-
CharLine
Constructor.
-
-
Method Details
-
getCharBlock
Returns the source text. -
addChars
Adds characters to this line at given index. -
removeChars
public void removeChars(int aStart, int anEnd) Removes characters in given range. -
updateText
protected void updateText()Updates text. -
getLineIndex
public int getLineIndex()Returns the index of this line -
getStartCharIndex
public int getStartCharIndex()Returns the start char index in source CharLines. -
getEndCharIndex
public int getEndCharIndex()Returns the end char index in source CharLines. -
getNext
Returns the next line. -
length
public int length()Override to return number of chars in line.- Specified by:
length
in interfaceCharSequence
-
charAt
public char charAt(int charIndex) Override to return char at given index in line.- Specified by:
charAt
in interfaceCharSequence
-
subSequence
Override to return subSequence of char range in line.- Specified by:
subSequence
in interfaceCharSequence
-