@Test public void testCreateIntArrayVarToString() { String setRangeName = "Range"; String arrayName = "a"; Set<Integer> setRange = new RangeExpression(1, 3).toNamedConstant(setRangeName); IntegerArray iav = IntegerArray.createVariable(arrayName, setRange); modelBuilder.add(setRange, iav); String output = modelWriter.toString(); StringBuilder expectedOutput = new StringBuilder(); expectedOutput.append("set of int: Range = 1..3;"); expectedOutput.append(System.lineSeparator()); expectedOutput.append( "array[" + setRangeName + "] of var int: " + arrayName + ";"); Assert.assertEquals(expectedOutput.toString(), output); }
@Override public String toString() { return allElements().map(Element::declare) .collect(Collectors.joining(System.lineSeparator())); }
ModelWriter implements IModelWriter { @Override public String toString() { return allElements().map(Element::declare) .collect(Collectors.joining(System.lineSeparator())); } }
ModelWriter implements IModelWriter { @Override public String toString() { return allElements().map(Element::declare) .collect(Collectors.joining(System.lineSeparator())); } ModelWriter(IModelBuilder modelBuilder); }
ModelWriter implements IModelWriter { @Override public String toString() { return allElements().map(Element::declare) .collect(Collectors.joining(System.lineSeparator())); } ModelWriter(IModelBuilder modelBuilder); @Override SolvingStrategy getSolvingStrategy(); @Override void setSolvingStrategy(SolvingStrategy solvingStrategy); @Override @Deprecated OutputStatement getOutputStatement(); @Override @Deprecated void setOutputStatement(OutputStatement outputStatement); @Override String toString(); @Override void toFile(File file); @Override void toOutputStream(OutputStream outputStream); @Override File toTempFile(); @Override Collection<Path> getSearchDirectories(); }
ModelWriter implements IModelWriter { @Override public String toString() { return allElements().map(Element::declare) .collect(Collectors.joining(System.lineSeparator())); } ModelWriter(IModelBuilder modelBuilder); @Override SolvingStrategy getSolvingStrategy(); @Override void setSolvingStrategy(SolvingStrategy solvingStrategy); @Override @Deprecated OutputStatement getOutputStatement(); @Override @Deprecated void setOutputStatement(OutputStatement outputStatement); @Override String toString(); @Override void toFile(File file); @Override void toOutputStream(OutputStream outputStream); @Override File toTempFile(); @Override Collection<Path> getSearchDirectories();  }