Class RDocumentCharSequence

  • All Implemented Interfaces:
    java.lang.CharSequence

    class RDocumentCharSequence
    extends java.lang.Object
    implements java.lang.CharSequence
    Allows iterating over a portion of an RDocument. This is of course not thread-safe, so should only be used on the EDT or with external synchronization.
    Version:
    1.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private RDocument doc  
      private int end  
      private int start  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      char charAt​(int index)  
      int length()  
      java.lang.CharSequence subSequence​(int start, int end)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.CharSequence

        chars, codePoints
    • Field Detail

      • start

        private int start
      • end

        private int end
    • Constructor Detail

      • RDocumentCharSequence

        RDocumentCharSequence​(RDocument doc,
                              int start)
        Creates a CharSequence representing the text in a document from the specified offset to the end of that document.
        Parameters:
        doc - The document.
        start - The starting offset in the document, inclusive.
      • RDocumentCharSequence

        RDocumentCharSequence​(RDocument doc,
                              int start,
                              int end)
        Constructor.
        Parameters:
        doc - The document.
        start - The starting offset in the document, inclusive.
        end - the ending offset in the document, exclusive.
    • Method Detail

      • charAt

        public char charAt​(int index)
        Specified by:
        charAt in interface java.lang.CharSequence
      • length

        public int length()
        Specified by:
        length in interface java.lang.CharSequence
      • subSequence

        public java.lang.CharSequence subSequence​(int start,
                                                  int end)
        Specified by:
        subSequence in interface java.lang.CharSequence
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface java.lang.CharSequence
        Overrides:
        toString in class java.lang.Object