コード例 #1
0
  public MatchPath getTailPath(int from) {
    if (from > lastIndex || from < 0) throw new IllegalArgumentException();

    AttributeMatchPath copy = pool.getAttributeMatchPath();
    for (int i = from; i <= lastIndex; i++) {
      copy.add(list[i]);
    }
    return copy;
  }
コード例 #2
0
  public AttributeMatchPath getHeadPath(int to) {
    if (to > lastIndex || to < 0) throw new IllegalArgumentException();

    AttributeMatchPath copy = pool.getAttributeMatchPath();
    copy.addAttribute(match);
    for (int i = 1; i <= to; i++) {
      copy.add(list[i]);
    }
    return copy;
  }
コード例 #3
0
 public MatchPath getTailPath(SRule from) {
   boolean containsFrom = false;
   AttributeMatchPath copy = pool.getAttributeMatchPath();
   for (int i = 0; i <= lastIndex; i++) {
     if (list[i] == from) {
       containsFrom = true;
     }
     if (containsFrom) {
       copy.add(list[i]);
     }
   }
   if (!containsFrom) throw new IllegalArgumentException();
   return copy;
 }
コード例 #4
0
 public AttributeMatchPath getHeadPath(SRule to) {
   boolean containsFrom = false;
   AttributeMatchPath copy = pool.getAttributeMatchPath();
   copy.addAttribute(match);
   for (int i = 1; i <= lastIndex; i++) {
     copy.add(list[i]);
     if (list[i] == to) {
       containsFrom = true;
       break;
     }
   }
   if (!containsFrom) throw new IllegalArgumentException();
   return copy;
 }