I
- input symbol classpublic final class Row<I> extends Object
Apart from that, a row is also associated with contents (via an integer id). The prefix of a row may be either a short or long prefix. In the former case, the row will also have successor rows (one-step futures) associated with it.
Constructor and Description |
---|
Row(Word<I> prefix,
int rowId)
Constructor.
|
Row(Word<I> prefix,
int rowId,
int alphabetSize)
Constructor for short prefix rows.
|
Modifier and Type | Method and Description |
---|---|
Word<I> |
getPrefix()
Retrieves the prefix (row label) associated with this row.
|
int |
getRowContentId()
Retrieves the ID of the row contents (may be
-1 if this row has not
yet been initialized). |
int |
getRowId()
Retrieves the unique row identifier associated with this row.
|
Row<I> |
getSuccessor(int inputIdx)
Retrieves the successor row for this short prefix row and the given alphabet
symbol (by index).
|
boolean |
hasContents() |
boolean |
isShortPrefix()
Retrieves whether this is a short prefix row.
|
void |
makeShort(int alphabetSize)
Makes this row a short prefix row.
|
void |
setRowContentId(int id)
Sets the ID of the row contents.
|
void |
setSuccessor(int inputIdx,
Row<I> succ)
Sets the successor row for this short prefix row and the given alphabet symbol
(by index).
|
public Row(Word<I> prefix, int rowId)
prefix
- the prefix (label) of this rowrowId
- the unique row identifierpublic void makeShort(int alphabetSize)
alphabetSize
- the size of the input alphabet.public Row<I> getSuccessor(int inputIdx)
inputIdx
- the index of the alphabet symbol.null
)public void setSuccessor(int inputIdx, Row<I> succ)
inputIdx
- the index of the alphabet symbol.succ
- the successor rowpublic Word<I> getPrefix()
public int getRowId()
public int getRowContentId()
-1
if this row has not
yet been initialized).public void setRowContentId(int id)
id
- the contents idpublic boolean isShortPrefix()
true
if this is a short prefix row, false
otherwise.public boolean hasContents()
Copyright © 2015. All rights reserved.