Пример #1
0
 public boolean canHaveAsChild(Thing thing) {
   if (null == thing || null == al_children) return false;
   for (final TemplateThing tt : al_children) {
     if (tt.type.equals(thing.getType())) {
       return true;
     }
   }
   return false;
 }
Пример #2
0
 /**
  * Determine whether this instance is nested inside the tree of an instance of the same type (for
  * example, a neurite_branch inside another neurite_branch)
  */
 public boolean isNested() {
   Thing p = this.parent;
   while (null != p) {
     if (this.type.equals(p.getType())) {
       return true; // nested!
     }
     p = p.getParent();
   }
   return false;
 }