eu.etaxonomy.cdm.model.description
Class FeatureTree

java.lang.Object
  extended by eu.etaxonomy.cdm.model.common.CdmBase
      extended by eu.etaxonomy.cdm.model.common.VersionableEntity
          extended by eu.etaxonomy.cdm.model.common.AnnotatableEntity
              extended by eu.etaxonomy.cdm.model.common.IdentifiableEntity
                  extended by eu.etaxonomy.cdm.model.common.TermBase
                      extended by eu.etaxonomy.cdm.model.description.FeatureTree
All Implemented Interfaces:
IAnnotatableEntity, ICdmBase, IIdentifiableEntity, ISourceable<IdentifiableSource>, IVersionableEntity, Serializable, Cloneable

@Indexed(index="eu.etaxonomy.cdm.model.description.FeatureTree")
public class FeatureTree
extends TermBase
implements Cloneable

The class to arrange features (characters) in a tree structure. Feature trees are essential as interactive multiple-access keys for determination process and for systematical output arrangement of description elements according to different goals but may also be used to define flat feature subsets for filtering purposes.
A feature tree is build on feature nodes.

This class corresponds partially to ConceptTreeDefType according to the SDD schema.

Note: The tree structure of features used for purposes described above has nothing in common with the possible hierarchical structure of features depending on their grade of precision.

Version:
1.0
Author:
m.doering
See Also:
MediaKey, Serialized Form

Field Summary
 
Fields inherited from class eu.etaxonomy.cdm.model.common.IdentifiableEntity
cacheStrategy, NOT_PROTECTED, PROTECTED, protectedTitleCache, titleCache
 
Fields inherited from class eu.etaxonomy.cdm.model.common.AnnotatableEntity
annotations, markers
 
Fields inherited from class eu.etaxonomy.cdm.model.common.CdmBase
uuid
 
Constructor Summary
protected FeatureTree()
          Class constructor: creates a new feature tree instance with an empty root node.
 
Method Summary
 Object clone()
          Clones this FeatureTree.
 Set<Feature> getDistinctFeatures()
          Computes a set of distinct features that are present in this feature tree
 FeatureNode getRoot()
          Returns the topmost feature node (root node) of this feature tree.
 List<FeatureNode> getRootChildren()
          Returns the (ordered) list of feature nodes which are immediate children of the root node of this feature tree.
 boolean isDescriptionSeparated()
          Returns the boolean value of the flag indicating whether the description elements associated with the features belonging to this feature tree should be treated separately (true) or not (false).
static FeatureTree NewInstance()
          Creates a new feature tree instance with an empty root node.
static FeatureTree NewInstance(List<Feature> featureList)
          Creates a new feature tree instance with a root node the children of which are the feature nodes build on the base of the given list of features.
static FeatureTree NewInstance(UUID uuid)
          Creates a new feature tree instance with an empty root node and assigns to the new feature tree the given UUID (universally unique identifier).
 void setDescriptionSeparated(boolean descriptionSeperated)
           
 void setRoot(FeatureNode root)
           
 
Methods inherited from class eu.etaxonomy.cdm.model.common.TermBase
addRepresentation, equals, getDescription, getDescription, getLabel, getLabel, getPreferredRepresentation, getPreferredRepresentation, getRepresentation, getRepresentations, getUri, removeRepresentation, setLabel, setLabel, setUri, toString
 
Methods inherited from class eu.etaxonomy.cdm.model.common.IdentifiableEntity
addCredit, addCredit, addExtension, addExtension, addRights, addSource, addSource, compareTo, generateTitle, getCacheStrategy, getCredits, getCredits, getData, getExtensions, getExtensions, getExtensions, getLsid, getRights, getSources, getTitleCache, getTruncatedCache, initListener, isProtectedTitleCache, removeCredit, removeCredit, removeExtension, removeRights, removeSource, setCacheStrategy, setLsid, setProtectedTitleCache, setTitleCache, setTitleCache
 
Methods inherited from class eu.etaxonomy.cdm.model.common.AnnotatableEntity
addAnnotation, addMarker, getAnnotations, getMarkers, hasMarker, hasMarker, removeAnnotation, removeMarker
 
Methods inherited from class eu.etaxonomy.cdm.model.common.VersionableEntity
getUpdated, getUpdatedBy, setUpdated, setUpdatedBy
 
Methods inherited from class eu.etaxonomy.cdm.model.common.CdmBase
addPropertyChangeListener, addPropertyChangeListener, clone, deproxy, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getCreated, getCreatedBy, getId, getUuid, hashCode, hasListeners, invokeSetMethod, invokeSetMethodWithNull, isInstanceOf, removePropertyChangeListener, removePropertyChangeListener, setCreated, setCreatedBy, setId, setUuid
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface eu.etaxonomy.cdm.model.common.IAnnotatableEntity
addAnnotation, addMarker, getAnnotations, getMarkers, hasMarker, hasMarker, removeAnnotation, removeMarker
 
Methods inherited from interface eu.etaxonomy.cdm.model.common.IVersionableEntity
getUpdated, getUpdatedBy, setUpdated, setUpdatedBy
 
Methods inherited from interface eu.etaxonomy.cdm.model.common.ICdmBase
getCreated, getCreatedBy, getId, getUuid, setCreated, setCreatedBy, setId, setUuid
 

Constructor Detail

FeatureTree

protected FeatureTree()
Class constructor: creates a new feature tree instance with an empty root node.

Method Detail

NewInstance

public static FeatureTree NewInstance()
Creates a new feature tree instance with an empty root node.

See Also:
NewInstance(UUID), NewInstance(List)

NewInstance

public static FeatureTree NewInstance(UUID uuid)
Creates a new feature tree instance with an empty root node and assigns to the new feature tree the given UUID (universally unique identifier).

Parameters:
uuid - the universally unique identifier
See Also:
NewInstance(), NewInstance(List)

NewInstance

public static FeatureTree NewInstance(List<Feature> featureList)
Creates a new feature tree instance with a root node the children of which are the feature nodes build on the base of the given list of features. This corresponds to a flat feature tree. For each feature within the list a new feature node without children nodes will be created.

Parameters:
featureList - the feature list
See Also:
NewInstance(), NewInstance(UUID)

isDescriptionSeparated

public boolean isDescriptionSeparated()
Returns the boolean value of the flag indicating whether the description elements associated with the features belonging to this feature tree should be treated separately (true) or not (false).

Returns:
the boolean value of the isDescriptionSeparated flag

setDescriptionSeparated

public void setDescriptionSeparated(boolean descriptionSeperated)
See Also:
isDescriptionSeparated()

getRoot

public FeatureNode getRoot()
Returns the topmost feature node (root node) of this feature tree. The root node does not have any parent. Since feature nodes recursively point to their child nodes the complete feature tree is defined by its root node.


setRoot

public void setRoot(FeatureNode root)
See Also:
getRoot()

getRootChildren

public List<FeatureNode> getRootChildren()
Returns the (ordered) list of feature nodes which are immediate children of the root node of this feature tree.


getDistinctFeatures

public Set<Feature> getDistinctFeatures()
Computes a set of distinct features that are present in this feature tree

Returns:

clone

public Object clone()
Clones this FeatureTree. This is a shortcut that enables to create a new instance that differs only slightly from this FeatureTree by modifying only some of the attributes. FeatureNodes always belong only to one tree, so all FeatureNodes are cloned to build the new FeatureTree

Overrides:
clone in class TermBase
See Also:
TermBase.clone(), Object.clone()


Copyright © 2007-2012 EDIT. All Rights Reserved.