Package snap.text

Class CharLine

java.lang.Object
snap.text.CharLine
All Implemented Interfaces:
CharSequence, CharSequenceX

public class CharLine extends Object implements CharSequenceX
This class represents a line of chars in a CharBlock.
  • Field Details

    • _charBlock

      protected CharBlock _charBlock
    • _index

      protected int _index
    • _startCharIndex

      protected int _startCharIndex
  • Constructor Details

    • CharLine

      public CharLine(CharBlock charBlock, int startCharIndex)
      Constructor.
  • Method Details

    • getCharBlock

      public CharBlock getCharBlock()
      Returns the source text.
    • addChars

      protected void addChars(CharSequence theChars, int anIndex)
      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

      public CharLine getNext()
      Returns the next line.
    • length

      public int length()
      Override to return number of chars in line.
      Specified by:
      length in interface CharSequence
    • charAt

      public char charAt(int charIndex)
      Override to return char at given index in line.
      Specified by:
      charAt in interface CharSequence
    • subSequence

      public CharSequence subSequence(int startCharIndex, int endCharIndex)
      Override to return subSequence of char range in line.
      Specified by:
      subSequence in interface CharSequence