Class CodeAreaSelection


  • public class CodeAreaSelection
    extends java.lang.Object
    Selection between two positions where begin represents origin point and end of the selection can be before or after begin.
    • Constructor Detail

      • CodeAreaSelection

        public CodeAreaSelection()
        Creates empty selection range.
      • CodeAreaSelection

        public CodeAreaSelection​(long start,
                                 long end)
        Creates selection range from start to end including the start and not including the end position.
        Parameters:
        start - selection start position
        end - selection end position without actual end position itself
      • CodeAreaSelection

        public CodeAreaSelection​(@Nullable
                                 SelectionRange selectionRange)
    • Method Detail

      • getStart

        public long getStart()
      • getEnd

        public long getEnd()
      • getFirst

        public long getFirst()
        Returns first data position of the selection.
        Returns:
        data position
      • getLast

        public long getLast()
        Returns last data position of the selection.
        Returns:
        data position
      • getLength

        public long getLength()
        Returns length of the selected area.
        Returns:
        length in bytes
      • isEmpty

        public boolean isEmpty()
        Returns true if selection is empty.
        Returns:
        true if selection is empty
      • isInSelection

        public boolean isInSelection​(long position)
        Checks if position belongs to this selection.
        Parameters:
        position - position
        Returns:
        true if position belongs to current selection range.
      • getRange

        @Nonnull
        public SelectionRange getRange()
        Returns selection range.
        Returns:
        selection range
      • setStart

        public void setStart​(long start)
      • setEnd

        public void setEnd​(long end)
      • setSelection

        public void setSelection​(@Nullable
                                 SelectionRange selectionRange)
      • setSelection

        public void setSelection​(long start,
                                 long end)
      • clearSelection

        public void clearSelection()