public class Concept extends Object
Constructor and Description |
---|
Concept(Concept parent)
Constructor.
|
Concept(Concept parent,
List<String> keywords)
Constructor.
|
Concept(Concept parent,
String keyword)
Constructor.
|
Concept(Concept parent,
String[] keywords)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(Concept concept)
Add a child to this node
|
Concept |
addChild(String concept)
Add a child to this node
|
void |
addKeyword(String keyword)
Add a keyword to the concept synset.
|
void |
addKeywords(List<String> keywords)
Add a list of synomym to the concept synset.
|
void |
addKeywords(String[] keywords)
Add a list of synomym to the concept synset.
|
List<Concept> |
getChildren()
Get all children concepts.
|
Set<String> |
getKeywords()
Returns the concept synonym set.
|
List<Concept> |
getPathFromRoot()
Returns the path from root to the given node.
|
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(String keyword)
Remove a keyword from the concept synset.
|
String |
toString() |
public Concept(Concept parent)
parent
- the parent conceptpublic Concept(Concept parent, String keyword)
keyword
- a keyword of this conceptparent
- the parent conceptpublic Concept(Concept parent, String[] keywords)
keywords
- a list of keywords of this conceptparent
- the parent conceptpublic boolean isLeaf()
public Set<String> getKeywords()
public void addKeyword(String keyword)
public void addKeywords(String[] keywords)
public void addKeywords(List<String> keywords)
public void removeKeyword(String keyword)
public List<Concept> getChildren()
public void addChild(Concept concept)
public boolean removeChild(Concept concept)
public boolean isAncestorOf(Concept concept)
public List<Concept> getPathFromRoot()
public List<Concept> getPathToRoot()
Copyright © 2015. All rights reserved.