コード例 #1
0
  protected MotechLocation addChildLocation(MotechLocation location) {
    if (!location.hasName()) return location;

    if (hasChildLocation(location)) {
      return getChildLocation(location);
    }
    childLocations.add(location);
    return location;
  }
コード例 #2
0
 protected MotechLocation getChildLocation(MotechLocation location) {
   for (MotechLocation childLocation : childLocations) {
     if (childLocation.equals(location)) return childLocation;
   }
   return null;
 }