Class TextPiece

    • Constructor Detail

      • TextPiece

        public TextPiece​(int start,
                         int end,
                         byte[] text,
                         PieceDescriptor pd,
                         int cpStart)
        Parameters:
        start - Beginning offset in main document stream, in characters.
        end - Ending offset in main document stream, in characters.
        text - The raw bytes of our text instead
      • TextPiece

        public TextPiece​(int start,
                         int end,
                         byte[] text,
                         PieceDescriptor pd)
        Parameters:
        start - Beginning offset in main document stream, in characters.
        end - Ending offset in main document stream, in characters.
        text - The raw bytes of our text
    • Method Detail

      • isUnicode

        public boolean isUnicode()
        Returns:
        If this text piece is unicode
      • getRawBytes

        public byte[] getRawBytes()
      • substring

        @Deprecated
        public String substring​(int start,
                                int end)
        Deprecated.
        Returns part of the string. Works only in characters, not in bytes!
        Parameters:
        start - Local start position, in characters
        end - Local end position, in characters
      • adjustForDelete

        @Deprecated
        public void adjustForDelete​(int start,
                                    int length)
        Deprecated.
        Adjusts the internal string for deletinging some characters within this.
        Overrides:
        adjustForDelete in class PropertyNode<TextPiece>
        Parameters:
        start - The start position for the delete, in characters
        length - The number of characters to delete
      • characterLength

        @Deprecated
        public int characterLength()
        Deprecated.
        Returns the length, in characters
      • bytesLength

        public int bytesLength()
        Returns the length, in bytes
      • getCP

        public int getCP()
        Returns the character position we start at.