@Entity public class FeatureNode extends VersionableEntity implements ITreeNode<FeatureNode>, java.lang.Cloneable
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.separator, treePrefix
Modifier | Constructor and Description |
---|---|
protected |
FeatureNode()
Class constructor: creates a new empty feature node instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addApplicableState(State applicableState)
|
void |
addChild(FeatureNode child)
Adds the given feature node at the end of the list of children of
this feature node.
|
void |
addChild(FeatureNode child,
int index)
Inserts the given feature node in the list of children of this feature node
at the given (index + 1) position.
|
void |
addInapplicableState(State inapplicableState)
Adds an existing
inapplicable state to the set of
inapplicable states described in
this feature node. |
java.lang.Object |
clone()
Clones this FeatureNode.
|
FeatureNode |
cloneDescendants() |
FeatureNode |
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<FeatureNode> |
getChildNodes()
Returns the (ordered) list of feature nodes which are children nodes of
this feature node.
|
java.util.Set<Feature> |
getDistinctFeaturesRecursive(java.util.Set<Feature> features)
Returns all features that are contained in this node or a child node
|
Feature |
getFeature()
Returns the
feature this feature node is based on. |
FeatureTree |
getFeatureTree() |
java.util.Set<State> |
getInapplicableIf()
|
int |
getIndex(FeatureNode node)
Returns the integer indicating the position of the given feature node
within the list of
children of this feature node. |
java.util.Set<State> |
getOnlyApplicableIf()
|
FeatureNode |
getParent()
Returns the feature node this feature node is a child of.
|
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 . |
static FeatureNode |
NewInstance()
Creates a new empty feature node instance.
|
static FeatureNode |
NewInstance(Feature feature)
Creates a new feature node instance only with the given
feature
(without parent and children). |
void |
removeApplicableState(State applicableState)
Removes one element from the set of
applicable states described in
this feature node. |
void |
removeChild(FeatureNode child)
Removes the given feature node from the list of
children
of 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 |
removeInapplicableState(State inapplicableState)
Removes one element from the set of
inapplicable states described in
this feature node. |
void |
removeNullValueFromChildren() |
void |
setFeature(Feature feature) |
protected void |
setFeatureTree(FeatureTree featureTree) |
protected void |
setParent(FeatureNode 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 '*'.
|
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, 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
protected FeatureNode()
public static FeatureNode NewInstance()
NewInstance(Feature)
public static FeatureNode NewInstance(Feature feature)
feature
(without parent and children).feature
- the feature assigned to the new feature nodeNewInstance()
public FeatureTree getFeatureTree()
protected void setFeatureTree(FeatureTree featureTree)
public void setFeature(Feature feature)
getFeature()
public FeatureNode getParent()
getParent
in interface ITreeNode<FeatureNode>
getChildNodes()
protected void setParent(FeatureNode parent)
parent
- the feature node to be set as parentgetParent()
@Deprecated protected void setSortIndex(java.lang.Integer sortIndex)
public java.util.List<FeatureNode> getChildNodes()
getChildNodes
in interface ITreeNode<FeatureNode>
public void addChild(FeatureNode child)
child
- the feature node to be addedgetChildNodes()
,
#setChildren(List)
,
addChild(FeatureNode, int)
,
removeChild(FeatureNode)
,
removeChild(int)
public void addChild(FeatureNode 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(FeatureNode)
,
removeChild(FeatureNode)
,
removeChild(int)
public void removeChild(FeatureNode child)
children
of this feature node.child
- the feature node which should be removedgetChildNodes()
,
addChild(FeatureNode, int)
,
addChild(FeatureNode)
,
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(FeatureNode, int)
,
addChild(FeatureNode)
,
removeChild(FeatureNode)
public FeatureNode 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(FeatureNode, int)
,
removeChild(int)
public int getChildCount()
getChildNodes()
public int getIndex(FeatureNode 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(FeatureNode, 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<State> getOnlyApplicableIf()
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.public void addApplicableState(State applicableState)
applicableState
- the applicable state to be added to this feature node#getApplicableState()
public void removeApplicableState(State applicableState)
applicable states
described in
this feature node.applicableState
- the applicable state which should be removed#getApplicableState()
,
addApplicableState(State)
public java.util.Set<State> getInapplicableIf()
states
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.public void addInapplicableState(State 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 void removeInapplicableState(State inapplicableState)
inapplicable states
described in
this feature node.inapplicableState
- the inapplicable state which should be removed#getInapplicableState()
,
addInapplicableState(State)
public java.util.Set<Feature> getDistinctFeaturesRecursive(java.util.Set<Feature> features)
featureNode
- features
- public FeatureNode cloneDescendants()
public java.lang.Object clone()
clone
in class VersionableEntity
VersionableEntity.clone()
,
Object.clone()
public java.lang.String treeIndex()
ITreeNode
treeIndex
in interface ITreeNode<FeatureNode>
public java.lang.String treeIndexLike()
ITreeNode
treeIndexLike
in interface ITreeNode<FeatureNode>
ITreeNode.treeIndex()
,
ITreeNode.treeIndexWc()
public java.lang.String treeIndexWc()
ITreeNode
treeIndexWc
in interface ITreeNode<FeatureNode>
ITreeNode.treeIndex()
,
ITreeNode.treeIndexLike()
@Deprecated public void setTreeIndex(java.lang.String newTreeIndex)
ITreeNode
setTreeIndex
in interface ITreeNode<FeatureNode>
@Deprecated public int treeId()
ITreeNode
id
of the tree object,
this node belongs to.treeId
in interface ITreeNode<FeatureNode>
public void removeNullValueFromChildren()
Copyright © 2007-2019 EDIT. All Rights Reserved.