|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
A node in the PTB. The label of the node is PTBLabel.
This is similar to various other
interfaces to the PTB, but Java™'s
treatment of method namespaces results in incompatibilities
between the Swing interfaces and/or DOM and other treebank
interfaces. The intended uses for this interface are mainly
querying and display.
The setter methods here are for internal use only with the exception of setLabel, and ptbAppendChild, and implementations may impose their own semantics. To mutate the tree, use the methods provided by the MutableTreeNode superinterface. Also note that the label and userObject are separate.
To avoid name clashes, some commonly used methods are prefixed with ptb.
Version 2 Changes: Two methods: "ptbSetAttribute" and
"ptbGetAttribute" have been removed for performance reasons.
There is no way to add custom attributes now. PTBLabel has
a corresponding change.
PTBNavigator| Field Summary | |
static java.lang.String |
GapIndexAttributeQName
|
static java.lang.String |
MovementIndexAttributeQName
|
static java.util.regex.Pattern |
NonPunctPOSPattern
|
static java.lang.String |
RawAttributeQName
|
static java.lang.String |
RolesAttributeQName
|
static java.lang.String |
TypeAttributeQName
|
| Method Summary | |
PTBLabel |
getLabel()
Get the associated PTBLabel |
java.lang.Object |
getUserObject()
|
boolean |
isPreterminal()
Equivalent to getChildCount() == 1 && getChildAt(0).isLeaf() |
boolean |
isPunct()
Equivalent to getParent().isPunctPreterminal() |
boolean |
isPunctPreterminal()
isPreterminal(), and getLabel().getType() is not in NonPunctuationPOS |
boolean |
isTerminal()
Equivalent to isLeaf() |
boolean |
isTracePreterminal()
Equivalent to isPreterminal() && hasRole("NONE") |
boolean |
isTraceTerminal()
Equivalent to getParent().isTracePreterminal() |
void |
ptbAppendChild(javax.swing.tree.MutableTreeNode newChild)
Adds the node supplied as the last child of this node. |
java.util.Enumeration |
ptbGetAttributes()
|
PTBTreeNode |
ptbGetFirstChild()
The first child of this node or null if it is a leaf. |
PTBTreeNode |
ptbGetLastChild()
The last child of this node or null if it is a leaf |
PTBTreeNode |
ptbGetNextSibling()
The next sibling if one exists, null otherwise. |
PTBTreeNode |
ptbGetPreviousSibling()
The previous sibling if one exists, null otherwise. |
void |
ptbSetFirstChild(PTBTreeNode firstChild)
Implementation specific. |
void |
ptbSetLastChild(PTBTreeNode lastChild)
Implementation specific. |
void |
ptbSetNextSibling(PTBTreeNode nextSibling)
Implementation specific. |
void |
ptbSetPreviousSibling(PTBTreeNode prevSibling)
Implementation specific. |
void |
save(java.io.Writer writer)
|
void |
save(java.io.Writer writer,
int indent,
int indentIncr)
|
void |
setLabel(PTBLabel label)
Sets the label |
| Methods inherited from interface javax.swing.tree.MutableTreeNode |
insert, remove, remove, removeFromParent, setParent, setUserObject |
| Methods inherited from interface javax.swing.tree.TreeNode |
children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf |
| Field Detail |
public static final java.util.regex.Pattern NonPunctPOSPattern
public static final java.lang.String TypeAttributeQName
public static final java.lang.String RolesAttributeQName
public static final java.lang.String MovementIndexAttributeQName
public static final java.lang.String GapIndexAttributeQName
public static final java.lang.String RawAttributeQName
| Method Detail |
public PTBLabel getLabel()
public void setLabel(PTBLabel label)
public boolean isTerminal()
public boolean isTraceTerminal()
public boolean isPreterminal()
public boolean isTracePreterminal()
public boolean isPunctPreterminal()
public boolean isPunct()
public PTBTreeNode ptbGetFirstChild()
public PTBTreeNode ptbGetLastChild()
public PTBTreeNode ptbGetPreviousSibling()
public PTBTreeNode ptbGetNextSibling()
public void ptbSetFirstChild(PTBTreeNode firstChild)
public void ptbSetLastChild(PTBTreeNode lastChild)
public void ptbSetPreviousSibling(PTBTreeNode prevSibling)
public void ptbSetNextSibling(PTBTreeNode nextSibling)
public void ptbAppendChild(javax.swing.tree.MutableTreeNode newChild)
public java.util.Enumeration ptbGetAttributes()
public java.lang.Object getUserObject()
public void save(java.io.Writer writer)
throws java.io.IOException
java.io.IOException
public void save(java.io.Writer writer,
int indent,
int indentIncr)
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||