@Test public void testGetRangeInt() { SpecificationReader reader = new SpecificationReader(); String xmlValue = "5 (3, 9)"; ParameterRangeDiscrete parameter = reader.getRangeInt(xmlValue); Assert.assertEquals(3, parameter.getLowerBound()); Assert.assertEquals(9, parameter.getUpperBound()); Assert.assertEquals((Integer) 5, parameter.getValue()); }
protected ParameterRangeDiscrete getRangeInt(String value) { Scanner scanner = new Scanner(value); scanner.useDelimiter("[\\s+,()]+"); int v = new Integer(scanner.next()); int lb = new Integer(scanner.next()); int ub = new Integer(scanner.next()); scanner.close(); return Parameters.range(v, lb, ub); }
SpecificationReader { protected ParameterRangeDiscrete getRangeInt(String value) { Scanner scanner = new Scanner(value); scanner.useDelimiter("[\\s+,()]+"); int v = new Integer(scanner.next()); int lb = new Integer(scanner.next()); int ub = new Integer(scanner.next()); scanner.close(); return Parameters.range(v, lb, ub); } }
SpecificationReader { protected ParameterRangeDiscrete getRangeInt(String value) { Scanner scanner = new Scanner(value); scanner.useDelimiter("[\\s+,()]+"); int v = new Integer(scanner.next()); int lb = new Integer(scanner.next()); int ub = new Integer(scanner.next()); scanner.close(); return Parameters.range(v, lb, ub); }  }
SpecificationReader { protected ParameterRangeDiscrete getRangeInt(String value) { Scanner scanner = new Scanner(value); scanner.useDelimiter("[\\s+,()]+"); int v = new Integer(scanner.next()); int lb = new Integer(scanner.next()); int ub = new Integer(scanner.next()); scanner.close(); return Parameters.range(v, lb, ub); }  Specification read(String filename); Specification read(File file); Specification read(InputStream in); Specification toSpecification(nu.xom.Element eSpecification); }
SpecificationReader { protected ParameterRangeDiscrete getRangeInt(String value) { Scanner scanner = new Scanner(value); scanner.useDelimiter("[\\s+,()]+"); int v = new Integer(scanner.next()); int lb = new Integer(scanner.next()); int ub = new Integer(scanner.next()); scanner.close(); return Parameters.range(v, lb, ub); }  Specification read(String filename); Specification read(File file); Specification read(InputStream in); Specification toSpecification(nu.xom.Element eSpecification);  }