public class Word extends DefaultMutableTreeNode implements Transferable
Word is basically a DefaultMutableTreeNode.
Its userObject is the word itself as a String.
It does not allow children.Word instances are transferable.allowsChildren, children, EMPTY_ENUMERATION, parent, userObject| Constructor and Description |
|---|
Word(Object word)
Creates a tree node with no children and parent, initialized
with the
word |
| Modifier and Type | Method and Description |
|---|---|
String |
getName()
Returns the name of this
Word. |
Object |
getTransferData(DataFlavor flavor)
This is a
Transferable method. |
DataFlavor[] |
getTransferDataFlavors()
This is a
Transferable method. |
boolean |
isDataFlavorSupported(DataFlavor flavor)
This is a
Transferable method. |
boolean |
isLeaf()
Overrides the
isLeaf() method in DefaultMutableTreeNode
so that only Words are treated as leaves and Concepts
are always treated as internal nodes. |
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toStringpublic Word(Object word)
word as its user object and that does not
allow children.public String getName()
Word.Wordpublic boolean isLeaf()
isLeaf() method in DefaultMutableTreeNode
so that only Words are treated as leaves and Concepts
are always treated as internal nodes. This is for the graphical representation
of tree nodes.isLeaf in interface TreeNodeisLeaf in class DefaultMutableTreeNodetruepublic Object getTransferData(DataFlavor flavor) throws IOException, UnsupportedFlavorException
Transferable method.getTransferData in interface TransferableIOExceptionUnsupportedFlavorExceptionpublic DataFlavor[] getTransferDataFlavors()
Transferable method.getTransferDataFlavors in interface Transferablepublic boolean isDataFlavorSupported(DataFlavor flavor)
Transferable method.isDataFlavorSupported in interface TransferableCopyright © 2016 New York University. All rights reserved.