Package org.exbin.bined
Class CodeAreaSelection
- java.lang.Object
-
- org.exbin.bined.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 Summary
Constructors Constructor Description CodeAreaSelection()
Creates empty selection range.CodeAreaSelection(long start, long end)
Creates selection range from start to end including the start and not including the end position.CodeAreaSelection(SelectionRange selectionRange)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearSelection()
long
getEnd()
long
getFirst()
Returns first data position of the selection.long
getLast()
Returns last data position of the selection.long
getLength()
Returns length of the selected area.SelectionRange
getRange()
Returns selection range.long
getStart()
boolean
isEmpty()
Returns true if selection is empty.boolean
isInSelection(long position)
Checks if position belongs to this selection.void
setEnd(long end)
void
setRange(SelectionRange selectionRange)
void
setSelection(long start, long end)
void
setSelection(SelectionRange selectionRange)
void
setStart(long start)
-
-
-
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 positionend
- 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()
-
setRange
public void setRange(SelectionRange selectionRange)
-
-