public class ClassNode extends Object implements IFolder, Transferable, Cloneable, Serializable
| Modifier and Type | Field and Description |
|---|---|
static DataFlavor |
CLASS_NODE_FLAVOR
flavor used for drag and drop
|
| Constructor and Description |
|---|
ClassNode(gate.creole.gazetteer.MappingNode mapNode)
Constructs a class node given a mapping node
|
ClassNode(gate.creole.ontology.OClass clas)
Constructs a class node given an ontology class
|
ClassNode(gate.creole.ontology.OInstance instance)
Constructs a class node given an ontology instance
|
ClassNode(gate.creole.ontology.Ontology o)
Constructs a root class node from an ontology
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSubNode(ClassNode sub)
Adds a sub node
|
Vector<ClassNode> |
children() |
static ClassNode |
createRootNode(gate.creole.ontology.Ontology o)
create a structure representing the class hierarchy of an ontology
|
static ClassNode |
createRootNode(gate.creole.ontology.Ontology o,
boolean includeInstances,
boolean includeAnonymousClasses) |
static ClassNode |
createRootNode(gate.creole.ontology.Ontology o,
gate.creole.gazetteer.MappingDefinition mapping,
Map<String,ClassNode> nameVsNode)
Creates a structure representing the class hierarchy of an ontology and
the gazetteerLists mapped to it.
|
boolean |
equals(Object obj) |
IFolder |
getChild(int index) |
int |
getChildCount() |
Iterator<ClassNode> |
getChildren() |
int |
getIndexOfChild(Object child) |
Object |
getSource()
Gets the Source object
|
Object |
getTransferData(DataFlavor df) |
DataFlavor[] |
getTransferDataFlavors() |
int |
hashCode() |
boolean |
isDataFlavorSupported(DataFlavor df) |
void |
removeSubNode(ClassNode sub)
Removes a sub class
|
void |
rename(String newName)
Renames this class node
|
void |
setChildren(Vector<ClassNode> chldrn) |
void |
setSource(Object o)
Sets the source object
|
String |
toString() |
public static final DataFlavor CLASS_NODE_FLAVOR
public ClassNode(gate.creole.ontology.Ontology o)
o - the ontologypublic ClassNode(gate.creole.ontology.OClass clas)
clas - ontology classpublic ClassNode(gate.creole.ontology.OInstance instance)
instance - ontology instancepublic ClassNode(gate.creole.gazetteer.MappingNode mapNode)
mapNode - mapping nodepublic static ClassNode createRootNode(gate.creole.ontology.Ontology o)
public static ClassNode createRootNode(gate.creole.ontology.Ontology o, boolean includeInstances, boolean includeAnonymousClasses)
public static ClassNode createRootNode(gate.creole.ontology.Ontology o, gate.creole.gazetteer.MappingDefinition mapping, Map<String,ClassNode> nameVsNode)
o - an ontologymapping - mapping definitionnameVsNode - : this is actually a return value: should be initialized
before passing to this method and afterwards one can find a
mapping of class names vs class nodes there.public int getIndexOfChild(Object child)
getIndexOfChild in interface IFolderpublic Iterator<ClassNode> getChildren()
getChildren in interface IFolderpublic String toString()
public int getChildCount()
getChildCount in interface IFolderpublic Object getSource()
public void setSource(Object o)
o - the source object to be setpublic void rename(String newName)
newName - the new name of the nodepublic void removeSubNode(ClassNode sub)
sub - the sub class to be removedpublic void addSubNode(ClassNode sub)
sub - the sub node to be addedpublic boolean isDataFlavorSupported(DataFlavor df)
isDataFlavorSupported in interface Transferablepublic Object getTransferData(DataFlavor df) throws UnsupportedFlavorException, IOException
getTransferData in interface TransferableUnsupportedFlavorExceptionIOExceptionpublic DataFlavor[] getTransferDataFlavors()
getTransferDataFlavors in interface Transferable