示例#1
0
 /*
  * @see org.primordion.xholon.base.IXholon#getSiblings()
  */
 public List getSiblings() {
   if (!isRootNode()) {
     List v = parent.getChildNodes(false);
     v.remove(this);
     return v;
   } else {
     return new ArrayList();
   }
 }
示例#2
0
 /**
  * Helper function to recursively get all children.
  *
  * @param v List that gets filled with children.
  * @param deep If true then return entire nested subtree, if false return only immediate children.
  * @return List containing children.
  */
 protected List getChildNodes(List v, boolean deep) {
   XholonTreeNode nextChild = getFirstChild();
   while (nextChild != null) {
     v.add(nextChild);
     if (deep) {
       ((XholonTreeNode) nextChild).getChildNodes(v, deep);
     }
     nextChild = nextChild.getNextSibling();
   }
   return v;
 }