Exemplo n.º 1
0
 public int expCount(int eq, Exp e) {
   int count = 0;
   if (equals(eq, e)) count++;
   Iterator<Exp> i = exps.iterator();
   while (i.hasNext()) {
     Exp ex = i.next();
     count += ex.expCount(eq, e);
   }
   return count;
 }
Exemplo n.º 2
0
  public int expCount(int id) {
    int result = 0;
    Exp ex;
    Iterator<Exp> i;

    i = exps.iterator();
    while (i.hasNext()) {
      ex = i.next();
      result += ex.expCount(id);
    }
    return result;
  }