Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.gjt.sp.jedit.textarea
Class Selection

    java.lang.Object
      org.gjt.sp.jedit.textarea.Selection

All Implemented Interfaces:
  java.lang.Cloneable

Direct Known Subclasses:
  Selection.Range, Selection.Rect

public abstract class Selection
extends java.lang.Object
implements java.lang.Cloneable

An abstract class that holds data on a region of selected text. As an abstract class, it cannot be used directly, but instead serves as a parent class for two specific types of selection structures:

- `Selection.Range` - represents an ordinary range of selected text.
- `Selection.Rect` - represents a rectangular selection.

Since:
  jEdit 3.2pre1
Version:
  $Id: Selection.java,v 1.22 2004/04/06 19:05:31 spestov Exp $
Author:
  Slava Pestov, John Gellene (API documentation)

Nested Class Summary
`static class` | `Selection.Range` An ordinary range selection.
`static class` | `Selection.Rect` A rectangular selection.

Method Summary
`java.lang.Object` | `clone()`
`int` | `getEnd()` Returns the end offset of this selection.
`abstract int` | `getEnd(Buffer buffer, int line)` Returns the end of the portion of the selection falling on the specified line.
`int` | `getEndLine()` Returns the ending line number of this selection.
`int` | `getStart()` Returns the start offset of this selection.
`abstract int` | `getStart(Buffer buffer, int line)` Returns the beginning of the portion of the selection falling on the specified line.
`int` | `getStartLine()` Returns the starting line number of this selection.
`boolean` | `overlaps(Selection s)` Returns if this selection and the specified selection overlap.
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Method Detail

### getStart

    public int getStart()

  Returns the start offset of this selection.

### getEnd

    public int getEnd()

  Returns the end offset of this selection.

### getStart

    public abstract int getStart(Buffer buffer,
                                 int line)

  Returns the beginning of the portion of the selection falling on the specified line. Used to manipulate selection text on a line-by-line basis.

  Parameters:
    `buffer` - The buffer
    `line` - The line number
  Since:
    jEdit 4.1pre1

### getEnd

    public abstract int getEnd(Buffer buffer,
                               int line)

  Returns the end of the portion of the selection falling on the specified line. Used to manipulate selection text on a line-by-line basis.

  Parameters:
    `buffer` - The buffer
    `line` - The line number
  Since:
    jEdit 4.1pre1

### getStartLine

    public int getStartLine()

  Returns the starting line number of this selection.

### getEndLine

    public int getEndLine()

  Returns the ending line number of this selection.

### overlaps

    public boolean overlaps(Selection s)

  Returns if this selection and the specified selection overlap.

  Parameters:
    `s` - The other selection
  Since:
    jEdit 4.1pre1

### toString

    public java.lang.String toString()

### clone

    public java.lang.Object clone()

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD