performed javacscript:fix and worked on documentation
[taxeditor.git] / taxeditor-store / src / main / java / eu / etaxonomy / taxeditor / model / FeatureNodeContainer.java
index cc50e1319101f70c08a1fd336bd18fe9b4cb004c..675550c093d285e44d6bc9db352bd14fc87d6d6c 100644 (file)
@@ -36,18 +36,19 @@ import eu.etaxonomy.cdm.model.description.TaxonDescription;
 /**
  * This class is a simple container to allow generation of a datastructure that
  * describes a feature tree according to a specific description element, i.e a tree
- * structure that halds only the {@link FeatureNode}s that are relevant for a specific 
+ * structure that halds only the {@link FeatureNode}s that are relevant for a specific
  * {@link TaxonDescription} as well as the {@link DescriptionElementBase} at the leaf level.
- * 
- * This kind of datastructure is needed by interface elements such as viewers and greatly simplify 
+ *
+ * This kind of datastructure is needed by interface elements such as viewers and greatly simplify
  * the handling of {@link FeatureTree}s in conjunction with {@link TaxonDescription}s.
- * 
+ *
  * @author n.hoffmann
  * @created Sep 20, 2010
  * @version 1.0
  */
 public class FeatureNodeContainer implements IAnnotatableEntity{
        
+       /** Constant <code>comparator</code> */
        public static Comparator<DescriptionElementBase> comparator = new Comparator<DescriptionElementBase>() {
 
                @Override
@@ -75,10 +76,10 @@ public class FeatureNodeContainer implements IAnnotatableEntity{
         * Traverses the given {@link FeatureNode} and computes a FeatureNodeContainer branch if the
         * given {@link TaxonDescription} has elements for the given feature node or any of its children
         * or null if there are no elements.
-        * 
-        * @param featureNode
-        * @param description
-        * @return
+        *
+        * @param description a {@link eu.etaxonomy.cdm.model.description.DescriptionBase} object.
+        * @param featureTree a {@link eu.etaxonomy.cdm.model.description.FeatureTree} object.
+        * @return a {@link eu.etaxonomy.taxeditor.model.FeatureNodeContainer} object.
         */
        public static FeatureNodeContainer CreateTree(FeatureTree featureTree, DescriptionBase description){
                
@@ -152,15 +153,20 @@ public class FeatureNodeContainer implements IAnnotatableEntity{
                return this;
        }
        
+       /**
+        * <p>Getter for the field <code>children</code>.</p>
+        *
+        * @return a {@link java.util.List} object.
+        */
        public List<FeatureNodeContainer> getChildren() {
                return children;
        }
 
        /**
         * Sets the list of children of this containers children
-        * 
-        * @param children
-        *  @throws IllegalStateException when <code>this</code> container contains a description element.
+        *
+        * @param children a {@link java.util.List} object.
+        *  @throws java.lang.IllegalStateException when <code>this</code> container contains a description element.
         */
        public void setChildren(List<FeatureNodeContainer> children) {
                if(descriptionElements.isEmpty()){
@@ -172,9 +178,9 @@ public class FeatureNodeContainer implements IAnnotatableEntity{
        
        /**
         * Adds a child container to the list of this containers children
-        * 
-        * @param container
-        *  @throws IllegalStateException when <code>this</code> container contains a description element.
+        *
+        * @param container a {@link eu.etaxonomy.taxeditor.model.FeatureNodeContainer} object.
+        *  @throws java.lang.IllegalStateException when <code>this</code> container contains a description element.
         */
        public void addChild(FeatureNodeContainer container){
                if(descriptionElements.isEmpty()){
@@ -186,19 +192,19 @@ public class FeatureNodeContainer implements IAnnotatableEntity{
 
        /**
         * If {@link #isLeaf()} is true, i.e. this container should have elements, returns the list of description elements.
-        * 
-        * @return
+        *
+        * @return a {@link java.util.List} object.
         */
        public List<DescriptionElementBase> getDescriptionElements() {
                return descriptionElements;
        }
 
        /**
-        * Cumulates description elements for <code>this</code> container as well as child feature nodes recursively, 
+        * Cumulates description elements for <code>this</code> container as well as child feature nodes recursively,
         * thus returning a list of description elements for the branch of the feature tree starting with <code>this</code>
         * node.
-        * 
-        * @return
+        *
+        * @return a {@link java.util.List} object.
         */
        public List<DescriptionElementBase> getDescriptionElementsForEntireBranch(){
                return getDescriptionElementsRecursively(new ArrayList<DescriptionElementBase>());
@@ -216,9 +222,10 @@ public class FeatureNodeContainer implements IAnnotatableEntity{
        }
        
        /**
-        * 
-        * @param descriptionElement
-        * @return
+        * <p>getFeatureNodeContainerForDescriptionElement</p>
+        *
+        * @param descriptionElement a {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase} object.
+        * @return a {@link eu.etaxonomy.taxeditor.model.FeatureNodeContainer} object.
         */
        public FeatureNodeContainer getFeatureNodeContainerForDescriptionElement (DescriptionElementBase descriptionElement) {
                List<FeatureNodeContainer> leafs = getLeafs();
@@ -246,9 +253,9 @@ public class FeatureNodeContainer implements IAnnotatableEntity{
        
        /**
         * Set the description element
-        * 
-        * @param descriptionElement
-        * @throws IllegalStateException when <code>this</code> container contains child container.
+        *
+        * @throws java.lang.IllegalStateException when <code>this</code> container contains child container.
+        * @param descriptionElements a {@link java.util.List} object.
         */
        public void setDescriptionElements(List<DescriptionElementBase> descriptionElements) {
                if(children.isEmpty()){
@@ -260,7 +267,8 @@ public class FeatureNodeContainer implements IAnnotatableEntity{
        
        /**
         * If the container is a leaf, it will hold a description element and no child containers
-        * @return
+        *
+        * @return a boolean.
         */
        public boolean isLeaf(){
                return ! descriptionElements.isEmpty() && children.isEmpty();
@@ -288,75 +296,115 @@ public class FeatureNodeContainer implements IAnnotatableEntity{
                return featureElements;
        }
        
+       /**
+        * <p>Setter for the field <code>featureNode</code>.</p>
+        *
+        * @param featureNode a {@link eu.etaxonomy.cdm.model.description.FeatureNode} object.
+        */
        public void setFeatureNode(FeatureNode featureNode) {
                this.featureNode = featureNode;
        }
 
+       /**
+        * <p>Getter for the field <code>featureNode</code>.</p>
+        *
+        * @return a {@link eu.etaxonomy.cdm.model.description.FeatureNode} object.
+        */
        public FeatureNode getFeatureNode() {
                return featureNode;
        }
        
+       /**
+        * <p>getFeature</p>
+        *
+        * @return a {@link eu.etaxonomy.cdm.model.description.Feature} object.
+        */
        public Feature getFeature(){
                return featureNode.getFeature();
        }
 
+       /**
+        * <p>Getter for the field <code>description</code>.</p>
+        *
+        * @return a {@link eu.etaxonomy.cdm.model.description.DescriptionBase} object.
+        */
        public DescriptionBase getDescription(){
                return description;
        }
        
-       /**************** NOT USED *****************/
-       
+       /**
+        * {@inheritDoc}
+        *
+        ************** NOT USED ****************
+        */
        @Override
        public User getUpdatedBy() {return null;}
 
+       /** {@inheritDoc} */
        @Override
        public void setUpdatedBy(User updatedBy) {}
 
+       /** {@inheritDoc} */
        @Override
        public DateTime getUpdated() {return null;}
 
+       /** {@inheritDoc} */
        @Override
        public void setUpdated(DateTime updated) {}
 
+       /** {@inheritDoc} */
        @Override
        public int getId() {return 0;}
 
+       /** {@inheritDoc} */
        @Override
        public void setId(int id) {}
 
+       /** {@inheritDoc} */
        @Override
        public UUID getUuid() {return null;}
 
+       /** {@inheritDoc} */
        @Override
        public void setUuid(UUID uuid) {}
 
+       /** {@inheritDoc} */
        @Override
        public DateTime getCreated() {return null;}
 
+       /** {@inheritDoc} */
        @Override
        public void setCreated(DateTime created) {}
 
+       /** {@inheritDoc} */
        @Override
        public User getCreatedBy() {return null;}
 
+       /** {@inheritDoc} */
        @Override
        public void setCreatedBy(User createdBy) {}
 
+       /** {@inheritDoc} */
        @Override
        public Set<Annotation> getAnnotations() {return null;}
 
+       /** {@inheritDoc} */
        @Override
        public void addAnnotation(Annotation annotation) {}
 
+       /** {@inheritDoc} */
        @Override
        public void removeAnnotation(Annotation annotation) {}
 
+       /** {@inheritDoc} */
        @Override
        public Set<Marker> getMarkers() { return null; }
 
+       /** {@inheritDoc} */
        @Override
        public void addMarker(Marker marker) {}
 
+       /** {@inheritDoc} */
        @Override
        public void removeMarker(Marker marker) {}
 }