@Entity public class TermNode<T extends DefinedTermBase> extends TermRelationBase<T,TermNode<T>,TermTree> implements ITreeNode<TermNode<T>>
feature tree
structure.
Feature nodes are the elementary components of such a tree since they might
be related to other nodes as a parent or as a child. A feature node belongs
at most to one feature tree. It cannot have more than one parent node but
may have several child nodes. Parent/child relations are bidirectional:
a node N1 is the parent of a node N2 if and only if the node N2 is a child of
the node N1.CLOB_LENGTH, uuid
separator, treePrefix
Modifier | Constructor and Description |
---|---|
protected |
TermNode()
Deprecated.
|
protected |
TermNode(TermType termType)
Class constructor: creates a new empty feature node instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addApplicableState(FeatureState applicableState)
|
FeatureState |
addApplicableState(Feature feature,
State applicableState) |
TermNode<T> |
addChild()
Creates a new node without a term and adds it to the end of
the list of children of
this node.
|
TermNode<T> |
addChild(T term)
Creates a new node for the given term and adds it to the end of
the list of children of
this node.
|
TermNode<T> |
addChild(TermNode<T> child)
Adds the given term node at the end of the list of children of
this term node.
|
TermNode<T> |
addChild(TermNode<T> child,
int index)
Inserts the given feature node in the list of children of this feature node
at the given (index + 1) position.
|
TermNode<T> |
addChild(T term,
int index)
Creates a new node for the given term and adds it at the
given (index + 1) position of the list of children of
this node.
|
void |
addInapplicableState(FeatureState inapplicableState)
Adds an existing
inapplicable state to the set of
inapplicable states described in
this feature node. |
FeatureState |
addInapplicableState(Feature feature,
State inapplicableState) |
java.util.Collection<? extends T> |
asTermListRecursive() |
java.lang.Object |
clone()
Clones this
TermNode . |
TermNode<T> |
cloneDescendants() |
TermNode<T> |
getChildAt(int childIndex)
Returns the feature node placed at the given (childIndex + 1) position
within the list of
children of this feature node. |
int |
getChildCount()
Returns the number of children nodes of this feature node.
|
java.util.List<TermNode<T>> |
getChildNodes()
Returns the (ordered) list of tree nodes which are children nodes of
this node.
|
java.util.Set<T> |
getDistinctTermsRecursive(java.util.Set<T> terms)
Returns all terms that are contained in this node or a child node
|
java.util.Set<FeatureState> |
getInapplicableIf()
Returns the set of
states belonging to a feature
implying rendering the concerned feature inapplicable. |
java.util.Set<T> |
getIndependentTermsRecursive()
Returns all terms that are contained in this node or a child node
as long as this node or the child nodes are not
dependent
on higher nodes/feature states. |
int |
getIndex(TermNode<T> node)
Returns the integer indicating the position of the given feature node
within the list of
children of this feature node. |
java.util.Set<FeatureState> |
getOnlyApplicableIf()
Returns the set of
feature states implying rendering the
concerned feature applicable. |
TermNode<T> |
getParent()
Returns the feature node this feature node is a child of.
|
boolean |
isDependent() |
boolean |
isLeaf()
Returns the boolean value indicating if this feature node has
children (false) or not (true).
|
boolean |
isRoot()
Whether
this node is the root node of the associated feature tree . |
void |
removeApplicableState(FeatureState applicableState)
Removes one element from the set of
applicable states described in
this feature node. |
void |
removeChild(int index)
Removes the feature node placed at the given (index + 1) position from
the list of
children of this feature node. |
void |
removeChild(TermNode<T> child)
Removes the given feature node from the list of
children
of this feature node. |
void |
removeInapplicableState(FeatureState inapplicableState)
Removes one element from the set of
inapplicable states described in
this feature node. |
void |
removeNullValueFromChildren() |
protected void |
setParent(TermNode<T> parent)
Assigns the given feature node as the parent of this feature node.
|
protected void |
setSortIndex(java.lang.Integer sortIndex)
Deprecated.
for internal use only.
|
void |
setTreeIndex(java.lang.String newTreeIndex)
Deprecated.
|
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 '*'.
|
checkTermType, getGraph, getTerm, getTermType, setGraph, setTerm
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
getCreated, getCreatedBy, getId, getUuid, isInstanceOf, isPersited, setCreated, setCreatedBy, setId, setUuid
checkTermTypeEqualOrDescendant, checkTermTypeNull, checkTermTypes
@Deprecated protected TermNode()
protected TermNode(TermType termType)
public TermNode<T> getParent()
getParent
in interface ITreeNode<TermNode<T extends DefinedTermBase>>
getChildNodes()
protected void setParent(TermNode<T> parent)
parent
- the feature node to be set as parentgetParent()
@Deprecated protected void setSortIndex(java.lang.Integer sortIndex)
public java.util.List<TermNode<T>> getChildNodes()
getChildNodes
in interface ITreeNode<TermNode<T extends DefinedTermBase>>
public TermNode<T> addChild(TermNode<T> child)
child
- the feature node to be addedgetChildNodes()
,
#setChildren(List)
,
addChild(TermNode, int)
,
removeChild(TermNode)
,
removeChild(int)
public TermNode<T> addChild()
getChildNodes()
,
#setChildren(List)
,
removeChild(TermNode)
,
removeChild(int)
public TermNode<T> addChild(T term)
term
- the term to be addedgetChildNodes()
,
#setChildren(List)
,
removeChild(TermNode)
,
removeChild(int)
public TermNode<T> addChild(T term, int index)
term
- the term to be addedgetChildNodes()
,
#setChildren(List)
,
removeChild(TermNode)
,
removeChild(int)
public TermNode<T> addChild(TermNode<T> child, int index)
child
- the feature node to be addedindex
- the integer indicating the position at which the child
should be addedgetChildNodes()
,
#setChildren(List)
,
addChild(TermNode)
,
removeChild(TermNode)
,
removeChild(int)
public void removeChild(TermNode<T> child)
children
of this feature node.child
- the feature node which should be removedgetChildNodes()
,
addChild(TermNode, int)
,
addChild(TermNode)
,
removeChild(int)
public void removeChild(int index)
children
of this feature node.
If the given index is out of bounds no child will be removed.index
- the integer indicating the position of the feature node to
be removedgetChildNodes()
,
addChild(TermNode, int)
,
addChild(TermNode)
,
removeChild(TermNode)
public TermNode<T> getChildAt(int childIndex)
children
of this feature node.
If the given index is out of bounds no child will be returned.childIndex
- the integer indicating the position of the feature nodegetChildNodes()
,
addChild(TermNode, int)
,
removeChild(int)
public int getChildCount()
getChildNodes()
public int getIndex(TermNode<T> node)
children
of this feature node.
If the list does not contain this node then -1 will be returned.node
- the feature node the position of which is being searchedaddChild(TermNode, int)
,
removeChild(int)
public boolean isLeaf()
getChildNodes()
,
getChildCount()
public boolean isRoot()
this
node is the root node of the associated feature tree
.true
if this
is the feature trees root node, false
if notpublic java.util.Set<FeatureState> getOnlyApplicableIf()
feature states
implying rendering the
concerned feature
applicable.
If at least one state is present in this set, in a given description
the feature
in this feature node is inapplicable
unless any of the listed controlling states is present in the parent
feature
description element categoricalData
.
This attribute is not equivalent to onlyApplicableIf in SDD as it is
attached directly to the child feature rather than the parent, which
allow having different applicable states for each child feature.#addApplicableState(State)
,
#removeApplicableState(State)
public void addApplicableState(FeatureState applicableState)
applicableState
- the applicable state to be added to this feature nodegetOnlyApplicableIf()
public FeatureState addApplicableState(Feature feature, State applicableState)
public void removeApplicableState(FeatureState applicableState)
applicable states
described in
this feature node.applicableState
- the applicable state which should be removed#getApplicableState()
,
#addApplicableState(State)
public java.util.Set<FeatureState> getInapplicableIf()
states belonging to a feature
implying rendering the concerned feature
inapplicable.
If at least one inapplicable state
is defined in the set,
in a given description the feature
attribute of
this feature node is inapplicable when any of the listed
controlling states is present.
This attribute is not equivalent to inapplicableIf in SDD as it is
attached directly to the child feature rather than the parent, which
allow having different inapplicability rules for each child feature.#addInapplicableState(State)
,
#removeInapplicableState(State)
public void addInapplicableState(FeatureState inapplicableState)
inapplicable state
to the set of
inapplicable states
described in
this feature node.inapplicableState
- the inapplicable state to be added to this feature node#getInapplicableState()
public FeatureState addInapplicableState(Feature feature, State inapplicableState)
public void removeInapplicableState(FeatureState inapplicableState)
inapplicable states
described in
this feature node.inapplicableState
- the inapplicable state which should be removed#getInapplicableState()
,
#addInapplicableState(State)
public java.util.Set<T> getDistinctTermsRecursive(java.util.Set<T> terms)
terms
- public java.util.Set<T> getIndependentTermsRecursive()
dependent
on higher nodes/feature states.public boolean isDependent()
true
if any of the sets inapplicableIf
and onlyApplicableIf
are not emptypublic java.util.Collection<? extends T> asTermListRecursive()
public java.lang.Object clone()
TermNode
. This is a shortcut that enables to create
a new instance that differs only slightly from this tree node by
modifying only some of the attributes.
The parent, the feature and the featureTree are the same as for the original feature node
the children are removedclone
in class TermRelationBase<T extends DefinedTermBase,TermNode<T extends DefinedTermBase>,TermTree>
VersionableEntity.clone()
,
Object.clone()
public java.lang.String treeIndex()
ITreeNode
treeIndex
in interface ITreeNode<TermNode<T extends DefinedTermBase>>
public java.lang.String treeIndexLike()
ITreeNode
treeIndexLike
in interface ITreeNode<TermNode<T extends DefinedTermBase>>
ITreeNode.treeIndex()
,
ITreeNode.treeIndexWc()
public java.lang.String treeIndexWc()
ITreeNode
treeIndexWc
in interface ITreeNode<TermNode<T extends DefinedTermBase>>
ITreeNode.treeIndex()
,
ITreeNode.treeIndexLike()
@Deprecated public void setTreeIndex(java.lang.String newTreeIndex)
ITreeNode
setTreeIndex
in interface ITreeNode<TermNode<T extends DefinedTermBase>>
@Deprecated public int treeId()
ITreeNode
id
of the tree object,
this node belongs to.treeId
in interface ITreeNode<TermNode<T extends DefinedTermBase>>
public void removeNullValueFromChildren()
Copyright © 2007-2020 EDIT. All Rights Reserved.