class SegGraph
extends java.lang.Object
For each start offset, a list of possible tokens is stored.
Modifier and Type | Field and Description |
---|---|
private int |
maxStart |
private java.util.Map<java.lang.Integer,java.util.ArrayList<SegToken>> |
tokenListTable
Map of start offsets to ArrayList of tokens at that position
|
Constructor and Description |
---|
SegGraph() |
Modifier and Type | Method and Description |
---|---|
void |
addToken(SegToken token)
Add a
SegToken to the mapping, creating a new mapping at the token's startOffset if one does not exist. |
int |
getMaxStart()
Get the highest start offset in the map
|
java.util.List<SegToken> |
getStartList(int s)
Get the list of tokens at the specified start offset
|
boolean |
isStartExist(int s)
Returns true if a mapping for the specified start offset exists
|
java.util.List<SegToken> |
makeIndex()
Set the
SegToken.index for each token, based upon its order by startOffset. |
java.lang.String |
toString() |
java.util.List<SegToken> |
toTokenList()
Return a
List of all tokens in the map, ordered by startOffset. |
private java.util.Map<java.lang.Integer,java.util.ArrayList<SegToken>> tokenListTable
private int maxStart
public boolean isStartExist(int s)
s
- startOffsetpublic java.util.List<SegToken> getStartList(int s)
s
- startOffsetpublic int getMaxStart()
public java.util.List<SegToken> makeIndex()
SegToken.index
for each token, based upon its order by startOffset.List
of these ordered tokens.public void addToken(SegToken token)
SegToken
to the mapping, creating a new mapping at the token's startOffset if one does not exist.token
- SegToken
public java.util.List<SegToken> toTokenList()
List
of all tokens in the map, ordered by startOffset.List
of all tokens in the map.public java.lang.String toString()
toString
in class java.lang.Object