@API(type=EXTENDABLE,
src=PRIVATE)
public abstract class TokenItem
extends java.lang.Object
implements java.lang.Comparable
Modifier and Type | Field and Description |
---|---|
protected TokenItem |
parent
The parent token.
|
Constructor and Description |
---|
TokenItem(int column,
java.lang.String value)
Make a private copy of type, column, value.
|
Modifier and Type | Method and Description |
---|---|
abstract boolean |
canBeNode()
Returns true if the token item can be a tree node.
|
boolean |
canHaveAttributes()
Checks if the token can have attributes.
|
int |
compareTo(java.lang.Object o)
Implements the compareTo() method of the Comparable interface.
|
boolean |
equals(java.lang.Object o)
Find if the specified object is a TokenItem with the same line and column.
|
int |
getColumn()
Get the column where the item is located.
|
int |
getLength()
Get the token's length.
|
int |
getLine()
Get the line of this token.
|
abstract TokenItem |
getMatchingTokenItem()
Get the maching token item.
|
java.lang.String |
getName()
Get the name of the token, filtering the special characters like> from
the TokenItem value.
|
TokenItem |
getParent()
Get the parent of the token item.
|
abstract int |
getType()
Get the token's type.
|
java.lang.String |
getValue()
Get the current value of this token.
|
int |
hashCode() |
abstract boolean |
isEnd() |
boolean |
isIgnorable()
Checks if a token item is ignorable.
|
abstract boolean |
isStart() |
void |
moveContext(ro.sync.outline.ProcessingContext context)
Moves only the current item and/or the previous item in context.
|
void |
setColumn(int column)
Set the start column of this token.
|
void |
setLT(ro.sync.outline.LineTokens lt)
Set the line for this token.
|
void |
setParent(TokenItem parent) |
void |
setValue(java.lang.String value)
Set the value of this token.
|
java.lang.String |
toString() |
void |
unbind()
Notifies a token item that it is removed.
|
boolean |
update(ro.sync.outline.ProcessingContext context)
Updates the processing context and eventual items so that the current
item is inserted in the current context.
|
protected TokenItem parent
public TokenItem(int column, java.lang.String value)
column
- The start column of the token.value
- The length of the token.public void setLT(ro.sync.outline.LineTokens lt)
lt
- The line this token belongs to.public java.lang.String toString()
toString
in class java.lang.Object
public int getColumn()
public void setColumn(int column)
column
- The start column of this token. 0 based.public int getLength()
public abstract int getType()
public void setValue(java.lang.String value)
value
- The value to be set for this token.public int getLine()
public java.lang.String getValue()
public java.lang.String getName()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- the Object to be compared.java.lang.ClassCastException
- if the specified object's type prevents it from
being compared to this Object.Comparable.compareTo(java.lang.Object)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- The specified object to be tested for equalityObject.equals(java.lang.Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public boolean update(ro.sync.outline.ProcessingContext context)
context
- The context this item is added on.public void moveContext(ro.sync.outline.ProcessingContext context)
context
- The context this item is added on.public final TokenItem getParent()
public void setParent(TokenItem parent)
parent
- The parent to set.public abstract boolean canBeNode()
public void unbind()
public abstract boolean isStart()
public abstract boolean isEnd()
public boolean isIgnorable()
public boolean canHaveAttributes()
public abstract TokenItem getMatchingTokenItem()
© Copyright SyncRO Soft SRL 2002 - 2016. All rights reserved.