コード例 #1
0
 @Override
 public Object clone() {
   NamedFragment copy = new NamedFragment(this.getName());
   copy.setOccurences(this.getOccurences());
   copy.resolve(this.resolved);
   return copy;
 }
コード例 #2
0
 @Override
 public boolean append(RuleFragment frag) {
   if (frag instanceof NamedFragment) {
     NamedFragment nf = (NamedFragment) frag;
     if (nf.getName().equals(this.getName())) {
       this.setOccurences(this.getOccurences().add(nf.getOccurences()));
       return true;
     }
   }
   return false;
 }