@Entity @ChildTaxaMustBeLowerRankThanParent(groups=Level3.class) @ChildTaxaMustNotSkipRanks(groups=Level3.class) @ChildTaxaMustDeriveNameFromParent(groups=Level3.class) public class TaxonNode extends AnnotatableEntity implements ITaxonTreeNode, ITreeNode<TaxonNode>, java.lang.Cloneable
annotations, markers
CLOB_LENGTH, uuid
separator, treePrefix
Modifier | Constructor and Description |
---|---|
protected |
TaxonNode() |
protected |
TaxonNode(Taxon taxon)
To create nodes either use
Classification#addChildTaxon(Taxon, Reference, String, Synonym)
or TaxonNode#addChildTaxon(Taxon, Reference, String, Synonym) |
protected |
TaxonNode(Taxon taxon,
Classification classification)
Deprecated.
setting of classification is handled in the addTaxonNode() method,
use TaxonNode(taxon) instead
|
Modifier and Type | Method and Description |
---|---|
TaxonNodeAgentRelation |
addAgentRelation(DefinedTerm type,
TeamOrPersonBase<?> agent) |
void |
addAgentRelation(TaxonNodeAgentRelation agentRelation) |
TaxonNode |
addChildNode(TaxonNode child,
int index,
Reference reference,
java.lang.String microReference)
Inserts the given taxon node in the list of children of this taxon node
at the given (index + 1) position.
|
TaxonNode |
addChildNode(TaxonNode childNode,
Reference reference,
java.lang.String microReference)
Moves a taxon node to a new parent.
|
TaxonNode |
addChildTaxon(Taxon taxon,
int index,
Reference citation,
java.lang.String microCitation)
Adds a taxon as a child of the ITreeNode at the index position.
|
TaxonNode |
addChildTaxon(Taxon taxon,
Reference citation,
java.lang.String microCitation)
Adds a taxon as a child of the ITreeNode at the last position.
|
java.lang.Object |
clone()
Clones this taxon node.
|
protected TaxonNode |
cloneDescendants()
Returns a set containing a clone of this node and of all nodes that are descendants of this node
|
boolean |
delete()
Remove this taxonNode From its taxonomic parent
|
boolean |
delete(boolean deleteChildren)
Remove this taxonNode From its taxonomic parent
|
boolean |
deleteChildNode(TaxonNode node)
This recursively removes all child nodes from this node and from this taxonomic view.
|
boolean |
deleteChildNode(TaxonNode node,
boolean deleteChildren)
Deletes the child node and also removes children of childnode
recursively if delete children is
true |
java.util.Set<TaxonNodeAgentRelation> |
getAgentRelations() |
java.util.List<TaxonNode> |
getAncestorList()
Returns the ancestor taxon nodes, that do have a taxon attached
(excludes the root node) starting with the highest
|
TaxonNode |
getAncestorOfRank(Rank rank)
Retrieves the first ancestor of the given rank.
|
protected java.util.Set<TaxonNode> |
getAncestors()
Returns all ancestor nodes of this node
|
java.util.List<Taxon> |
getAncestorTaxaList()
Returns the ancestor taxa, starting with the highest (e.g.
|
java.util.List<TaxonNode> |
getChildNodes()
Returns the list of direct child nodes of
this ITreeNode. |
Classification |
getClassification() |
int |
getCountChildren() |
protected java.util.Set<TaxonNode> |
getDescendants()
Returns a set containing this node and all nodes that are descendants of this node
|
java.util.Map<Language,LanguageString> |
getExcludedNote()
Returns the
multi-language text to add a note to the
excluded flag. |
java.lang.String |
getExcludedNote(Language language)
Returns the excluded note string in the given
language |
java.lang.String |
getMicroReference() |
Rank |
getNullSafeRank() |
TaxonNode |
getParent()
Returns the parent node of this node.
|
Reference |
getReference() |
java.lang.Integer |
getSortIndex() |
Synonym |
getSynonymToBeUsed() |
Taxon |
getTaxon() |
boolean |
hasChildNodes()
Whether this taxon has child nodes
|
boolean |
hasTaxon() |
boolean |
isAncestor(TaxonNode possibleChild)
Whether this TaxonNode is an ascendant of (or equal to) the given TaxonNode.
|
boolean |
isDescendant(TaxonNode possibleParent)
Whether this TaxonNode is a descendant of (or equal to) the given TaxonNode
|
boolean |
isDoubtful() |
boolean |
isExcluded() |
boolean |
isTopmostNode()
Whether this TaxonNode is a direct child of the classification TreeNode
|
boolean |
isUnplaced() |
void |
putExcludedNote(LanguageString excludedNote)
Adds a translated
text in a particular language
to the multilanguage text used to add a note to
the excluded flag. |
void |
putExcludedNote(Language language,
java.lang.String text)
Creates a
language string based on the given text string
and the given language and adds it to the multi-language text used to annotate the excluded flag. |
void |
removeAgentRelation(TaxonNodeAgentRelation agentRelation) |
void |
removeChild(int index)
Removes the child node placed at the given (index + 1) position
from the list of
children of this taxon node. |
protected boolean |
removeChildNode(TaxonNode childNode)
Removes the child node from this node.
|
void |
removeExcludedNote(Language lang)
Removes from the
multilanguage text used to annotate
the excluded flag the one language string
with the given language . |
void |
removeNullValueFromChildren() |
protected void |
setChildNodes(java.util.List<TaxonNode> childNodes) |
protected void |
setClassification(Classification classification)
Deprecated.
for internal use only
|
protected void |
setCountChildren(int countChildren)
Deprecated.
for internal use only
|
void |
setDoubtful(boolean doubtful) |
void |
setExcluded(boolean excluded) |
void |
setMicroReference(java.lang.String microReference) |
protected void |
setParent(TaxonNode parent)
Sets the parent of this taxon node.
In most cases you would want to call setParentTreeNode(ITreeNode) which handles updating of the bidirectional relationship |
protected void |
setParentTreeNode(TaxonNode parent,
int index)
Sets the parent of this taxon node to the given parent.
|
void |
setReference(Reference reference) |
protected void |
setSortIndex(java.lang.Integer i)
Deprecated.
for internal use only
|
void |
setSynonymToBeUsed(Synonym synonymToBeUsed) |
void |
setTaxon(Taxon taxon) |
void |
setTreeIndex(java.lang.String treeIndex)
Deprecated.
|
void |
setUnplaced(boolean unplaced) |
int |
treeId()
Deprecated.
|
java.lang.String |
treeIndex()
Returns the tree index of this tree node.
|
java.lang.String |
treeIndexLike()
Returns the tree index followed by an SQL wildcard '%'.
|
java.lang.String |
treeIndexWc()
Returns the tree index followed by a asterisk wildcard '*'.
|
addAnnotation, addMarker, addMarker, getAnnotations, getAnnotations, getMarkers, getMarkers, hasMarker, hasMarker, markerValue, removeAnnotation, removeMarker, removeMarker, setAnnotations
cloneLanguageString, equals, getUpdated, getUpdatedBy, setUpdated, setUpdatedBy
addPropertyChangeListener, addPropertyChangeListener, addToSetWithChangeEvent, deproxy, deproxy, fireOnCreateEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getCreated, getCreatedBy, getId, getUserFriendlyDescription, getUserFriendlyFieldName, getUserFriendlyTypeName, getUuid, hashCode, hasListeners, initListener, instanceToString, invokeSetMethod, invokeSetMethodWithNull, isBlank, isInstanceOf, isNotBlank, isPersited, removeFromSetWithChangeEvent, removePropertyChangeListener, removePropertyChangeListener, replaceInList, setCreated, setCreatedBy, setId, setNewEntityListener, setUuid, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
addAnnotation, addMarker, getAnnotations, getMarkers, getMarkers, hasMarker, hasMarker, markerValue, removeAnnotation, removeMarker, removeMarker
getUpdated, getUpdatedBy, setUpdated, setUpdatedBy
getCreated, getCreatedBy, getId, getUuid, isInstanceOf, isPersited, setCreated, setCreatedBy, setId, setUuid
protected TaxonNode()
@Deprecated protected TaxonNode(Taxon taxon, Classification classification)
Classification#addChildTaxon(Taxon, Reference, String, Synonym)
or TaxonNode#addChildTaxon(Taxon, Reference, String, Synonym)
taxon
- classification
- protected TaxonNode(Taxon taxon)
Classification#addChildTaxon(Taxon, Reference, String, Synonym)
or TaxonNode#addChildTaxon(Taxon, Reference, String, Synonym)
taxon
- public boolean isUnplaced()
public void setUnplaced(boolean unplaced)
public boolean isDoubtful()
public void setDoubtful(boolean doubtful)
public boolean isExcluded()
public void setExcluded(boolean excluded)
public java.lang.Integer getSortIndex()
@Deprecated protected void setSortIndex(java.lang.Integer i)
i
- public Taxon getTaxon()
public void setTaxon(Taxon taxon)
public java.util.List<TaxonNode> getChildNodes()
ITaxonTreeNode
this
ITreeNode.getChildNodes
in interface ITreeNode<TaxonNode>
getChildNodes
in interface ITaxonTreeNode
protected void setChildNodes(java.util.List<TaxonNode> childNodes)
public Classification getClassification()
@Deprecated protected void setClassification(Classification classification)
classification
- public java.lang.String getMicroReference()
getMicroReference
in interface ITaxonTreeNode
public void setMicroReference(java.lang.String microReference)
public Reference getReference()
getReference
in interface ITaxonTreeNode
public void setReference(Reference reference)
public int getCountChildren()
@Deprecated protected void setCountChildren(int countChildren)
countChildren
- public TaxonNode getParent()
ITreeNode
null
if this
node is a root node.protected void setParent(TaxonNode parent)
parent
- setParentTreeNode(ITreeNode)
public java.util.Map<Language,LanguageString> getExcludedNote()
multi-language text
to add a note to the
excluded flag. The different language strings
contained in the multi-language text should all have the same meaning.public java.lang.String getExcludedNote(Language language)
language
language
- the language in which the description string looked for is formulatedgetExcludedNote()
,
putExcludedNote(Language, String)
public void putExcludedNote(LanguageString excludedNote)
text in a particular language
to the multilanguage text
used to add a note to
the excluded
flag.excludedNote
- the language string adding a note to the excluded flag
in a particular languagegetExcludedNote()
,
#putExcludedNote(String, Language)
public void putExcludedNote(Language language, java.lang.String text)
language string
based on the given text string
and the given language
and adds it to the multi-language text
used to annotate the excluded flag.text
- the string annotating the excluded flag
in a particular languagelanguage
- the language in which the text string is formulatedgetExcludedNote()
,
putExcludedNote(LanguageString)
,
removeExcludedNote(Language)
public void removeExcludedNote(Language lang)
multilanguage text
used to annotate
the excluded flag the one language string
with the given language
.lang
- the language in which the language string to be removed
has been formulatedgetExcludedNote()
public java.util.Set<TaxonNodeAgentRelation> getAgentRelations()
public TaxonNodeAgentRelation addAgentRelation(DefinedTerm type, TeamOrPersonBase<?> agent)
public void addAgentRelation(TaxonNodeAgentRelation agentRelation)
public void removeAgentRelation(TaxonNodeAgentRelation agentRelation)
public Synonym getSynonymToBeUsed()
public void setSynonymToBeUsed(Synonym synonymToBeUsed)
public java.lang.String treeIndex()
ITreeNode
@Deprecated public void setTreeIndex(java.lang.String treeIndex)
ITreeNode
setTreeIndex
in interface ITreeNode<TaxonNode>
public java.lang.String treeIndexLike()
ITreeNode
treeIndexLike
in interface ITreeNode<TaxonNode>
ITreeNode.treeIndex()
,
ITreeNode.treeIndexWc()
public java.lang.String treeIndexWc()
ITreeNode
treeIndexWc
in interface ITreeNode<TaxonNode>
ITreeNode.treeIndex()
,
ITreeNode.treeIndexLike()
public TaxonNode addChildTaxon(Taxon taxon, Reference citation, java.lang.String microCitation)
ITaxonTreeNode
addChildTaxon
in interface ITaxonTreeNode
public TaxonNode addChildTaxon(Taxon taxon, int index, Reference citation, java.lang.String microCitation)
ITaxonTreeNode
addChildTaxon
in interface ITaxonTreeNode
public TaxonNode addChildNode(TaxonNode childNode, Reference reference, java.lang.String microReference)
addChildNode
in interface ITaxonTreeNode
childNode
- the taxon node to be moved to the new parentpublic TaxonNode addChildNode(TaxonNode child, int index, Reference reference, java.lang.String microReference)
addChildNode
in interface ITaxonTreeNode
child
- the taxon node to be addedindex
- the integer indicating the position at which the child
should be addedgetChildNodes()
,
#addChildNode(TaxonNode, Reference, String, Synonym)
,
deleteChildNode(TaxonNode)
,
#deleteChildNode(int)
public boolean deleteChildNode(TaxonNode node)
ITaxonTreeNode
deleteChildNode
in interface ITaxonTreeNode
public boolean deleteChildNode(TaxonNode node, boolean deleteChildren)
true
node
- deleteChildren
- protected boolean removeChildNode(TaxonNode childNode)
childNode
- public void removeChild(int index)
children
of this taxon node.
Sets the parent and the classification of the child
node to null.
If the given index is out of bounds no child will be removed.index
- the integer indicating the position of the taxon node to
be removedgetChildNodes()
,
addChildNode(TaxonNode, Reference, String)
,
addChildNode(TaxonNode, int, Reference, String)
,
deleteChildNode(TaxonNode)
public boolean delete()
public boolean delete(boolean deleteChildren)
@Deprecated public int treeId()
ITreeNode
id
of the tree object,
this node belongs to.protected void setParentTreeNode(TaxonNode parent, int index)
parent
- protected java.util.Set<TaxonNode> getDescendants()
protected TaxonNode cloneDescendants()
protected java.util.Set<TaxonNode> getAncestors()
public TaxonNode getAncestorOfRank(Rank rank)
null
is returned.
If this
taxon is already of given rank this taxon is returned.rank
- the rank the ancestor should havepublic java.util.List<Taxon> getAncestorTaxaList()
public java.util.List<TaxonNode> getAncestorList()
public boolean isTopmostNode()
public boolean isDescendant(TaxonNode possibleParent)
possibleParent
- true
if this is a descendantpublic boolean isAncestor(TaxonNode possibleChild)
possibleChild
- true
if this is a ancestor of the given child parameterpublic boolean hasChildNodes()
hasChildNodes
in interface ITaxonTreeNode
public boolean hasTaxon()
public Rank getNullSafeRank()
public void removeNullValueFromChildren()
public java.lang.Object clone()
clone
in class AnnotatableEntity
eu.etaxonomy.cdm.model.media.IdentifiableEntity#clone()
,
Object.clone()
Copyright © 2007-2020 EDIT. All Rights Reserved.