/** * Checks whether "arg1" supports "arg2", i.e. whether there * is an even-length path from "arg1" to "arg2". * @param arg1 an AbstractArgument. * @param arg2 an AbstractArgument. * @return "true" iff "arg1" supports "arg2". */ public boolean isSupport(Argument arg1, Argument arg2){ return this.isSupport(arg1, arg2, new HashSet<Argument>()); }
/** * Checks whether "arg1" indirectly attacks "arg2", i.e. whether there * is an odd-length path from "arg1" to "arg2". * @param arg1 an AbstractArgument. * @param arg2 an AbstractArgument. * @param visited already visited arguments. * @return "true" iff "arg1" indirectly attacks "arg2". */ private boolean isIndirectAttack(Argument arg1, Argument arg2, Set<Argument> visited){ if(this.isAttackedBy(arg2,arg1)) return true; visited.add(arg1); Set<Argument> attackedArguments = this.getAttacked(arg1); attackedArguments.removeAll(visited); for(Argument attacked : attackedArguments){ if(this.isSupport(attacked, arg2)) return true; } return false; }