EquationSystem { {{ static ClassGraph cg = new ClassGraph(true, false); static String usedVarsSpec = "from EquationSystem via -> *,rhs,* to Variable"; static String definedVarsSpec = "from EquationSystem via -> *,lhs,* to Variable"; HashSet collectVars(String travspec){ Visitor v = new Visitor(){ HashSet return_val = new HashSet(); void before(Variable v1) {return_val.add(v1);} public Object getReturnValue(){return return_val;} }; return (HashSet) cg.traverse(this, travspec, v); } HashSet getUsedVars() { return this.collectVars(usedVarsSpec); } HashSet getDefinedVars() { return this.collectVars(definedVarsSpec); } }} }