public class Concept
extends java.lang.Object
Constructor and Description |
---|
Concept(Concept parent,
java.lang.String... keywords)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(Concept concept)
Add a child to this node
|
Concept |
addChild(java.lang.String concept)
Add a child to this node
|
void |
addKeywords(java.lang.String... keywords)
Add a list of synomym to the concept synset.
|
java.util.List<Concept> |
getChildren()
Get all children concepts.
|
java.util.Set<java.lang.String> |
getKeywords()
Returns the concept synonym set.
|
java.util.List<Concept> |
getPathFromRoot()
Returns the path from root to the given node.
|
java.util.List<Concept> |
getPathToRoot()
Returns the path from the given node to the root.
|
boolean |
isAncestorOf(Concept concept)
Returns true if this concept is an ancestor of the given concept.
|
boolean |
isLeaf()
Check if a node is a leaf in the taxonomy tree.
|
boolean |
removeChild(Concept concept)
Remove a child to this node
|
void |
removeKeyword(java.lang.String keyword)
Remove a keyword from the concept synset.
|
java.lang.String |
toString() |
public Concept(Concept parent, java.lang.String... keywords)
keywords
- a list of keywords of this conceptparent
- the parent conceptpublic boolean isLeaf()
public java.util.Set<java.lang.String> getKeywords()
public void addKeywords(java.lang.String... keywords)
public void removeKeyword(java.lang.String keyword)
public java.util.List<Concept> getChildren()
public Concept addChild(java.lang.String concept)
public void addChild(Concept concept)
public boolean removeChild(Concept concept)
public boolean isAncestorOf(Concept concept)
public java.util.List<Concept> getPathFromRoot()
public java.util.List<Concept> getPathToRoot()
public java.lang.String toString()
toString
in class java.lang.Object