Package propagation.impl

Source Code of propagation.impl.NodeImpl

package propagation.impl;

import propagation.Node;
import propagation.PropagationRule;
import propagation.StateItem;

import java.util.ArrayList;
import java.util.List;

public class NodeImpl implements Node {
   private String rdn_;

   private String fdn_;

   private List childNodes_ = new ArrayList();

   private List upperNodes_ = new ArrayList();

   private Node parentNode_;

   private List stateItems_ = new ArrayList();

   private StateItem summaryItem_;

   private transient PropagationRule rule_ = new ORSummaryRule();

   public void setNodeRDN(String rdn) {
      this.rdn_ = rdn;
   }

   public String getNodeRDN() {
      return this.rdn_;
   }

   public void setNodeFDN(String fdn) {
      this.fdn_ = fdn;
   }

   public String getNodeFDN() {
      return this.fdn_;
   }

   public void addChildNode(Node child) {
      if (child != null) {
         childNodes_.add(child);
      }
   }

   public List getChildren() {
      return childNodes_;
   }

   public void addUpperNode(Node upperNode) {
      if (upperNode != null) {
         upperNodes_.add(upperNode);
      }
   }

   public List getUpperNodes() {
      return upperNodes_;
   }

   public void setParentNode(Node parent) {
      if (parent != null) {
         parentNode_ = parent;
      }
   }

   public Node getParentNode() {
      return this.parentNode_;
   }

   public void addStateItem(StateItem stateItem) {
      if (stateItem != null) {
         stateItems_.add(stateItem);
      }
   }

   public void setSummaryStateItem(StateItem stateItem) {
      if (stateItem != null) {
         this.summaryItem_ = stateItem;
      }
   }

   public StateItem getSummaryStateItem() {
      return this.summaryItem_;
   }

   public void setPropagationRule(PropagationRule rule) {
      if (rule != null) {
         this.rule_ = rule;
      }
   }

   public PropagationRule getPropagationRule() {
      return rule_;
   }


   public List getStateItems() {
      return this.stateItems_;
   }

   public StateItem findStateItem(long itemId) {
      StateItem retItem = null;
      int size = stateItems_.size();
      for (int idx = 0; idx < size; idx++) {
         StateItem stateItem = (StateItem) stateItems_.get(idx);
         if (stateItem.getItemId() == itemId) {
            retItem = stateItem;
            break;
         }
      }

      return retItem;
   }

   public String toString() {
      return getNodeFDN();
   }
}
TOP

Related Classes of propagation.impl.NodeImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.