DataType
- The type of data that occurred in the text.public abstract class AbstractOccurrenceInText<DataType> extends AbstractCloneableSerializable implements OccurrenceInText<DataType>
OccurrenceInText
interface. It
holds the start and length.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_LENGTH
The default length is 0.
|
static int |
DEFAULT_START
The default start is 0.
|
protected int |
length
The length of the occurrence.
|
protected int |
start
The starting point of the occurrence.
|
Constructor and Description |
---|
AbstractOccurrenceInText()
Creates a new
AbstractOccurrenceInText . |
AbstractOccurrenceInText(int start,
int length)
Creates a new
AbstractOccurrenceInText . |
Modifier and Type | Method and Description |
---|---|
int |
getLength()
Gets the length of text where the occurrence appears.
|
int |
getStart()
Gets the starting index of the occurrence in the text.
|
void |
setLength(int length)
Sets the length of the occurrence.
|
void |
setStart(int start)
Sets the starting point of the occurrence.
|
clone
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getData
public static final int DEFAULT_START
public static final int DEFAULT_LENGTH
protected int start
protected int length
public AbstractOccurrenceInText()
AbstractOccurrenceInText
.public AbstractOccurrenceInText(int start, int length)
AbstractOccurrenceInText
.start
- The starting point of the occurrence.length
- The length of the occurrence.public int getStart()
OccurrenceInText
getStart
in interface OccurrenceInText<DataType>
public void setStart(int start)
start
- The starting point of the occurrence.public int getLength()
OccurrenceInText
getLength
in interface OccurrenceInText<DataType>
public void setLength(int length)
length
- The length of the occurrence.