|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectxtc.tree.Node
xtc.tree.Token
public abstract class Token
A token. A token is an immutable tree node containing a source file symbol.
| Constructor Summary | |
|---|---|
Token()
Create a new token. |
|
| Method Summary | |
|---|---|
static java.lang.String |
cast(java.lang.Object o)
Cast the specified object to a string. |
java.lang.Object |
get(int index)
Get the child at the specified index. |
abstract java.lang.String |
getTokenText()
Treat this node as a token and get its text. |
boolean |
hasTraversal()
Determine whether this node supports generic traversal of its children. |
boolean |
isToken()
Determine whether this node is a token. |
java.lang.Object |
set(int index,
java.lang.Object value)
Set the child at the specified index to the specified value. |
int |
size()
Get the number of children. |
static boolean |
test(java.lang.Object o)
Determine whether the specified object represents a string. |
Token |
toToken()
Get this node as a token. |
| Methods inherited from class xtc.tree.Node |
|---|
add, add, addAll, addAll, addAll, addAll, addAllTo, addNode, contains, getBoolean, getBooleanProperty, getGeneric, getList, getLocation, getName, getNode, getProperty, getString, getStringProperty, hasLocation, hasName, hasProperty, hasVariable, indexOf, isAnnotation, isEmpty, isGeneric, isList, iterator, lastIndexOf, properties, remove, removeProperty, setLocation, setLocation, setProperty, strip, toAnnotation, toList, toString, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Token()
| Method Detail |
|---|
public boolean isToken()
Node
isToken in class Nodetrue if this node is a token.Tokenpublic Token toToken()
Node
toToken in class Nodepublic abstract java.lang.String getTokenText()
Node
getTokenText in class NodeNode.strip()public boolean hasTraversal()
Nodefalse.
hasTraversal in class Nodetrue if this node supports generic traversal
of its children.public int size()
Node
size in class Nodepublic java.lang.Object get(int index)
Node
get in class Nodeindex - The index.
test(Object),
cast(Object),
GNode.test(Object),
GNode.cast(Object)
public java.lang.Object set(int index,
java.lang.Object value)
Node
set in class Nodeindex - The index.value - The new value.
public static final boolean test(java.lang.Object o)
o - The object.
true if the specifed object is a string or a
possibly annotated token.public static final java.lang.String cast(java.lang.Object o)
o - The object.
java.lang.ClassCastException - Signals that the object does not
describe a string.test(Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||