@Test public void testGetVariable() throws Exception { Program program = new Program("test"); Variable v = Variable.create(Type.INT, "v", "10"); program.addVariable(v); assertEquals(v, program.getVariable("v")); }
public final Variable getVariable(final String id) { return this.variables.get(id); }
Program { public final Variable getVariable(final String id) { return this.variables.get(id); } }
Program { public final Variable getVariable(final String id) { return this.variables.get(id); } Program(final String id); }
Program { public final Variable getVariable(final String id) { return this.variables.get(id); } Program(final String id); final String getId(); final Variable getVariable(final String id); final void addVariable(final Variable var); final Function getFunction(final String id); final void addFunction(final Function function); final OperationSequence getBody(); Set<Variable> getVariables(); Set<Function> getFunctions(); @Override final String toString(); }
Program { public final Variable getVariable(final String id) { return this.variables.get(id); } Program(final String id); final String getId(); final Variable getVariable(final String id); final void addVariable(final Variable var); final Function getFunction(final String id); final void addFunction(final Function function); final OperationSequence getBody(); Set<Variable> getVariables(); Set<Function> getFunctions(); @Override final String toString();  }