Commit 42d1e639 authored by Daniel Le Berre's avatar Daniel Le Berre

StringBuffer -> StringBuilder.

parent 9aed674b
Pipeline #83 passed with stage
in 11 minutes and 40 seconds
......@@ -63,7 +63,7 @@ public class AraliaParser {
@Override
public String toString() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(this.nodeType.getPrefix());
if (this.nodeType == LogicFormulaNodeType.TERM) {
sb.append(this.label);
......@@ -177,7 +177,7 @@ public class AraliaParser {
private LogicFormulaNode readTerm(String s) {
LogicFormulaNode node = new LogicFormulaNode(LogicFormulaNodeType.TERM);
StringBuffer label = new StringBuffer();
StringBuilder label = new StringBuilder();
for (char c : s.toCharArray()) {
if ((c != '(') && (c != ')')) {
label.append(c);
......
......@@ -200,7 +200,7 @@ public class Br4cpAraliaReader {
private String removeSpaces(String line) {
char[] chars = line.toCharArray();
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < chars.length; ++i) {
if (chars[i] != ' ') {
sb.append(chars[i]);
......
......@@ -32,7 +32,7 @@ public class Options {
}
public void parseCommandLine(String args[]) {
StringBuffer errBuff = new StringBuffer();
StringBuilder errBuff = new StringBuilder();
for (String arg : args) {
if (arg.startsWith("-")) {
try {
......
......@@ -82,7 +82,7 @@ public abstract class AbstractLauncher implements Serializable, ILogAble {
protected transient PrintWriter out = new PrintWriter(System.out, true);
private StringBuffer logBuffer;
private StringBuilder logBuffer;
private boolean displaySolutionLine = true;
......@@ -429,7 +429,7 @@ public abstract class AbstractLauncher implements Serializable, ILogAble {
}
protected void bufferizeLog() {
this.logBuffer = new StringBuffer();
this.logBuffer = new StringBuilder();
}
protected void flushLog() {
......
......@@ -342,7 +342,7 @@ public final class Vec<T> implements IVec<T> {
*/
@Override
public String toString() {
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
for (int i = 0; i < this.nbelem - 1; i++) {
stb.append(this.myarray[i]);
stb.append(","); //$NON-NLS-1$
......
......@@ -348,7 +348,7 @@ public final class VecInt implements IVecInt {
*/
@Override
public String toString() {
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
for (int i = 0; i < this.nbelem - 1; i++) {
stb.append(this.myarray[i]);
stb.append(","); //$NON-NLS-1$
......
......@@ -309,7 +309,7 @@ public class AtLeast implements Propagatable, Constr, Undoable, Serializable {
*/
@Override
public String toString() {
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
stb.append("Card (" + this.lits.length + ") : ");
for (int lit : this.lits) {
// if (voc.isUnassigned(lits[i])) {
......@@ -413,7 +413,7 @@ public class AtLeast implements Propagatable, Constr, Undoable, Serializable {
}
public String toString(VarMapper mapper) {
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
for (int lit : this.lits) {
stb.append(" + "); //$NON-NLS-1$
stb.append(mapper.map(LiteralsUtils.toDimacs(lit)));
......
......@@ -374,7 +374,7 @@ public final class MaxWatchCard
*/
@Override
public String toString() {
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
if (this.lits.length > 0) {
if (this.voc.isUnassigned(this.lits[0])) {
......@@ -509,7 +509,7 @@ public final class MaxWatchCard
}
public String toString(VarMapper mapper) {
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
if (this.lits.length > 0) {
if (this.voc.isUnassigned(this.lits[0])) {
......
......@@ -438,7 +438,7 @@ public class MinWatchCard
*/
@Override
public String toString() {
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
// stb.append("Card (" + this.lits.length + ") : ");
if (this.lits.length > 0) {
// if (voc.isUnassigned(lits[0])) {
......@@ -734,7 +734,7 @@ public class MinWatchCard
if (mapper == null) {
return toString();
}
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
// stb.append("Card (" + this.lits.length + ") : ");
if (this.lits.length > 0) {
// if (voc.isUnassigned(lits[0])) {
......
......@@ -151,7 +151,7 @@ public abstract class BinaryClause implements Propagatable, Constr,
@Override
public String toString() {
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
stb.append(Lits.toString(this.head));
stb.append("["); //$NON-NLS-1$
stb.append(this.voc.valueToString(this.head));
......@@ -283,7 +283,7 @@ public abstract class BinaryClause implements Propagatable, Constr,
if (mapper == null) {
return toString();
}
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
stb.append(mapper.map(LiteralsUtils.toDimacs(this.head)));
stb.append("["); //$NON-NLS-1$
stb.append(this.voc.valueToString(this.head));
......
......@@ -259,7 +259,7 @@ public class CBClause implements Constr, Undoable, Propagatable, Serializable {
@Override
public String toString() {
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
for (int i = 0; i < lits.length; i++) {
stb.append(lits[i]);
stb.append("["); //$NON-NLS-1$
......
......@@ -194,7 +194,7 @@ public abstract class HTClause implements Propagatable, Constr, Serializable {
@Override
public String toString() {
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
stb.append(Lits.toString(this.head));
stb.append("["); //$NON-NLS-1$
stb.append(this.voc.valueToString(this.head));
......@@ -351,7 +351,7 @@ public abstract class HTClause implements Propagatable, Constr, Serializable {
}
public String toString(VarMapper mapper) {
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
stb.append(mapper.map(LiteralsUtils.toDimacs(this.head)));
stb.append("["); //$NON-NLS-1$
stb.append(this.voc.valueToString(this.head));
......
......@@ -169,7 +169,7 @@ public abstract class WLClause implements Propagatable, Constr, Serializable {
@Override
public String toString() {
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
for (int lit : this.lits) {
stb.append(Lits.toString(lit));
stb.append("["); //$NON-NLS-1$
......@@ -184,7 +184,7 @@ public abstract class WLClause implements Propagatable, Constr, Serializable {
if (mapper == null) {
return toString();
}
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
for (int lit : this.lits) {
stb.append(mapper.map(LiteralsUtils.toDimacs(lit)));
stb.append("["); //$NON-NLS-1$
......
......@@ -102,7 +102,7 @@ public final class IntQueue implements Serializable {
@Override
public String toString() {
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
stb.append(">"); //$NON-NLS-1$
for (int i = this.first; i < this.size - 1; i++) {
stb.append(this.myarray[i]);
......
......@@ -109,7 +109,7 @@ public class SearchParams implements Serializable {
*/
@Override
public String toString() {
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
for (Field field : SearchParams.class.getDeclaredFields()) {
if (!field.getName().startsWith("serial")
&& !field.getName().startsWith("class")) {
......
......@@ -2019,7 +2019,7 @@ public class Solver<D extends DataStructureFactory>
* @see java.lang.Object#toString()
*/
public String toString(String prefix) {
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
Object[] objs = { this.dsfactory, this.learner, this.params, this.order,
this.simplifier, this.restarter,
this.learnedConstraintsDeletionStrategy };
......
......@@ -63,7 +63,7 @@ public class AAGReader extends Reader {
@Override
public String decode(int[] model) {
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
for (int i = 0; i < this.nbinputs; i++) {
stb.append(model[i] > 0 ? 1 : 0);
}
......
......@@ -62,7 +62,7 @@ public class AIGReader extends Reader {
@Override
public String decode(int[] model) {
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
for (int i = 0; i < this.nbinputs; i++) {
stb.append(model[i] > 0 ? 1 : 0);
}
......
......@@ -263,7 +263,7 @@ public class DimacsReader extends Reader implements Serializable {
@Override
public String decode(int[] model) {
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
for (int element : model) {
stb.append(element);
stb.append(" ");
......
......@@ -124,7 +124,7 @@ public class EfficientScanner implements Serializable {
}
public BigInteger nextBigInteger() throws IOException, ParseFormatException {
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
char currentChar = skipSpaces();
if (currentChar == '-') {
stb.append(currentChar);
......@@ -149,7 +149,7 @@ public class EfficientScanner implements Serializable {
* never used in that method.
*/
public String next() throws IOException, ParseFormatException {
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
char currentChar = skipSpaces();
while (currentChar != ' ' && currentChar != '\n') {
stb.append(currentChar);
......@@ -169,7 +169,7 @@ public class EfficientScanner implements Serializable {
}
public String nextLine() throws IOException {
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
char car;
do {
car = (char) this.in.read();
......
......@@ -254,7 +254,7 @@ public class LecteurDimacs extends Reader implements Serializable {
private char manageCommentLine() throws IOException {
char car;
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
do {
car = (char) this.in.read();
stb.append(car);
......@@ -292,7 +292,7 @@ public class LecteurDimacs extends Reader implements Serializable {
@Override
public String decode(int[] model) {
StringBuffer stb = new StringBuffer();
StringBuilder stb = new StringBuilder();
for (int element : model) {
stb.append(element);
stb.append(" ");
......
......@@ -92,7 +92,7 @@ public class DimacsArrayReader implements Serializable {
}
public String decode(int[] model) {
StringBuffer stb = new StringBuffer(4 * model.length);
StringBuilder stb = new StringBuilder(4 * model.length);
for (int element : model) {
stb.append(element);
stb.append(" ");
......
......@@ -57,7 +57,7 @@ public class DimacsStringSolver extends AbstractOutputSolver
*/
private static final long serialVersionUID = 1L;
private StringBuffer out;
private StringBuilder out;
private int firstCharPos;
......@@ -70,11 +70,11 @@ public class DimacsStringSolver extends AbstractOutputSolver
}
public DimacsStringSolver(int initSize) {
this.out = new StringBuffer(initSize);
this.out = new StringBuilder(initSize);
this.initBuilderSize = initSize;
}
public StringBuffer getOut() {
public StringBuilder getOut() {
return this.out;
}
......@@ -174,7 +174,7 @@ public class DimacsStringSolver extends AbstractOutputSolver
public void reset() {
this.fixedNbClauses = false;
this.firstConstr = true;
this.out = new StringBuffer(this.initBuilderSize);
this.out = new StringBuilder(this.initBuilderSize);
this.maxvarid = 0;
}
......
......@@ -305,7 +305,7 @@ public class ManyCore<S extends ISolver>
}
public String toString(String prefix) {
StringBuffer res = new StringBuffer();
StringBuilder res = new StringBuilder();
res.append(prefix);
res.append("ManyCore solver with ");
res.append(this.numberOfSolvers);
......
......@@ -93,7 +93,7 @@ public class ConnectionCtrBuilder {
}
private boolean buildCtrMinOrMax(XVarInteger[] list, Condition condition, boolean isMax) {
final StringBuffer leftOpBuf = new StringBuffer();
final StringBuilder leftOpBuf = new StringBuilder();
leftOpBuf.append(isMax ? "max(" : "min(");
String norm = CtrBuilderUtils.normalizeCspVarName(list[0].id);
leftOpBuf.append(norm);
......@@ -143,7 +143,7 @@ public class ConnectionCtrBuilder {
private boolean buildCtrMinOrMaxAtIndex(XVarInteger[] list, XVarInteger index, int startIndex, boolean isMax) {
String normIndex = CtrBuilderUtils.normalizeCspVarName(index.id);
StringBuffer maxExprBuf = new StringBuffer();
StringBuilder maxExprBuf = new StringBuilder();
maxExprBuf.append(isMax ? "max(" : "min(");
for(int i=0; i<list.length; ++i) {
String normVar = CtrBuilderUtils.normalizeCspVarName(list[i].id);
......@@ -165,7 +165,7 @@ public class ConnectionCtrBuilder {
// index==i => and(x0<xi,...,x(i-1)<xi)
String normIndex = CtrBuilderUtils.normalizeCspVarName(index.id);
String normMax = CtrBuilderUtils.normalizeCspVarName(list[i-startIndex].id);
StringBuffer andExprBuf = new StringBuffer();
StringBuilder andExprBuf = new StringBuilder();
andExprBuf.append("and(");
for(int j=0; j<i-startIndex; ++j) {
String normCurVar = CtrBuilderUtils.normalizeCspVarName(list[j].id);
......@@ -184,7 +184,7 @@ public class ConnectionCtrBuilder {
// index==i => and(x(i+1)<xi,...,xn<xi)
String normIndex = CtrBuilderUtils.normalizeCspVarName(index.id);
String normMax = CtrBuilderUtils.normalizeCspVarName(list[i-startIndex].id);
StringBuffer andExprBuf = new StringBuffer();
StringBuilder andExprBuf = new StringBuilder();
andExprBuf.append("and(");
for(int j=i-startIndex+1; j<list.length; ++j) {
String normCurVar = CtrBuilderUtils.normalizeCspVarName(list[j].id);
......@@ -271,7 +271,7 @@ public class ConnectionCtrBuilder {
// or(ne(i,index),and(eq(i,index),eq(xi,value),ne(x0,value),...,ne(xi-1,value)))
String normIndex = CtrBuilderUtils.normalizeCspVarName(index.id);
String normValue = CtrBuilderUtils.normalizeCspVarName(value.id);
StringBuffer sbuf = new StringBuffer();
StringBuilder sbuf = new StringBuilder();
sbuf.append("or(ne(").append(i+startIndex).append(',').append(normIndex).append("),and(eq(").append(i+startIndex).append(',').append(normIndex).append("),eq(").append(CtrBuilderUtils.normalizeCspVarName(list[i].id)).append(',').append(normValue).append(')');
for(int j=0; j<i; ++j) {
sbuf.append(",ne(").append(CtrBuilderUtils.normalizeCspVarName(list[j].id)).append(',').append(normValue).append(')'); // end NE operator
......@@ -287,7 +287,7 @@ public class ConnectionCtrBuilder {
// or(ne(i,index),and(eq(i,index),eq(xi,value),ne(xi+1,value),...,ne(xn,value)))
String normIndex = CtrBuilderUtils.normalizeCspVarName(index.id);
String normValue = CtrBuilderUtils.normalizeCspVarName(value.id);
StringBuffer sbuf = new StringBuffer();
StringBuilder sbuf = new StringBuilder();
sbuf.append("or(ne(").append(i+startIndex).append(',').append(normIndex).append("),and(eq(").append(i+startIndex).append(',').append(normIndex).append("),eq(").append(CtrBuilderUtils.normalizeCspVarName(list[i].id)).append(',').append(normValue).append(')'); // end EQ2 operator
for(int j=i+1; j<list.length; ++j) {
sbuf.append(",ne(").append(CtrBuilderUtils.normalizeCspVarName(list[j].id)).append(',').append(normValue).append(')');
......
......@@ -52,7 +52,7 @@ public class CountingCtrBuilder {
public boolean buildCtrSum(String id, XVarInteger[] list, int[] coeffs, Condition condition) {
String varId;
StringBuffer exprBuf = new StringBuffer();
StringBuilder exprBuf = new StringBuilder();
exprBuf.append(((ConditionRel)condition).operator.toString().toLowerCase());
exprBuf.append('(');
for(int i=0; i<list.length-1; ++i) {
......@@ -91,7 +91,7 @@ public class CountingCtrBuilder {
}
private boolean buildCtrCount(String id, XVarInteger[] list, int[] values, StringCondition condition) {
StringBuffer inExprBuf = new StringBuffer();
StringBuilder inExprBuf = new StringBuilder();
inExprBuf.append("set(").append(Integer.toString(values[0]));
for(int i=1; i<values.length; ++i) {
inExprBuf.append(',');
......@@ -114,7 +114,7 @@ public class CountingCtrBuilder {
private boolean buildCtrCount(String id, XVarInteger[] list, XVarInteger[] values, StringCondition condition) {
int listLength = list.length;
StringBuffer inExprBuf = new StringBuffer();
StringBuilder inExprBuf = new StringBuilder();
inExprBuf.append("set(").append(CtrBuilderUtils.normalizeCspVarName(values[0].id));
for(int i=1; i<values.length; ++i) {
inExprBuf.append(',');
......@@ -174,7 +174,7 @@ public class CountingCtrBuilder {
}
private boolean buildCtrNValuesExcept(String id, XVarInteger[] list, int[] except, StringCondition strCond) {
StringBuffer sbuf = new StringBuffer();
StringBuilder sbuf = new StringBuilder();
boolean firstAddMember = true;
sbuf.append("add(");
for(int i=0; i<list.length; ++i) {
......@@ -228,7 +228,7 @@ public class CountingCtrBuilder {
if(!closed) return false;
for(int i=0; i<list.length; ++i) {
String normVar = CtrBuilderUtils.normalizeCspVarName(list[i].id);
StringBuffer exprBuff = new StringBuffer();
StringBuilder exprBuff = new StringBuilder();
exprBuff.append("or(eq(").append(normVar).append(',').append(values[0]).append(')');
for(int j=1; j<values.length; ++j) {
exprBuff.append(",eq(").append(normVar).append(',').append(values[j]).append(')');
......
......@@ -73,7 +73,7 @@ public class CtrBuilderUtils {
}
public static String chainExpressionsForAssociativeOp(String[] exprs, String op) {
StringBuffer exprBuf = new StringBuffer();
StringBuilder exprBuf = new StringBuilder();
exprBuf.append(op).append('(').append(exprs[0]);
for(int i=1; i<exprs.length; ++i) exprBuf.append(',').append(exprs[i]);
exprBuf.append(')');
......@@ -81,7 +81,7 @@ public class CtrBuilderUtils {
}
public static String chainExpressionsAssociative(String[] exprs, String op) {
StringBuffer exprBuff = new StringBuffer();
StringBuilder exprBuff = new StringBuilder();
exprBuff.append(exprs[0]);
for(int i=1; i<exprs.length; ++i) {
exprBuff.append(op);
......@@ -121,13 +121,13 @@ public class CtrBuilderUtils {
}
public static String syntaxTreeRootToString(final XNodeParent<XVarInteger> syntaxTreeRoot) {
final StringBuffer treeToString = new StringBuffer();
final StringBuilder treeToString = new StringBuilder();
fillSyntacticStrBuffer(syntaxTreeRoot, treeToString);
return treeToString.toString();
}
private static void fillSyntacticStrBuffer(final XNode<XVarInteger> child,
final StringBuffer treeToString) {
final StringBuilder treeToString) {
if(child instanceof XNodeLeaf<?>) {
treeToString.append(CtrBuilderUtils.normalizeCspVarName(child.toString()));
return;
......
......@@ -49,7 +49,7 @@ public class ElementaryCtrBuilder {
public boolean buildCtrClause(String id, XVarInteger[] pos, XVarInteger[] neg) {
int nPos = pos.length;
StringBuffer expressionBuffer = new StringBuffer();
StringBuilder expressionBuffer = new StringBuilder();
boolean first = true;
expressionBuffer.append("or(");
for(int i=0; i<nPos; ++i) {
......
......@@ -167,7 +167,7 @@ public class GenericCtrBuilder {
}
private boolean buildCtrSupports(XVarInteger[] list, int[][] tuples) {
StringBuffer sbuf = new StringBuffer();
StringBuilder sbuf = new StringBuilder();
sbuf.append("or(");
boolean firstTuple = true;
for(int[] tuple : tuples) {
......
......@@ -102,7 +102,7 @@ public class ObjBuilder {
}
private String opExpr(final String op, final XVarInteger[] xlist, final int[] xcoeffs) {
final StringBuffer sb = new StringBuffer();
final StringBuilder sb = new StringBuilder();
sb.append(op);
sb.append('(');
sb.append(chainObjVars(xlist, xcoeffs));
......@@ -111,7 +111,7 @@ public class ObjBuilder {
}
private String chainObjVars(final XVarInteger[] xlist, final int[] xcoeffs) {
final StringBuffer sb = new StringBuffer();
final StringBuilder sb = new StringBuilder();
for(int i=0; i<xlist.length; ++i) {
if(i>0) sb.append(',');
if(xcoeffs[i] == 1) {
......@@ -163,7 +163,7 @@ public class ObjBuilder {
}
private String nValuesExpr(final XVarInteger[] list, final int[] coeffs) {
final StringBuffer sbuf = new StringBuffer();
final StringBuilder sbuf = new StringBuilder();
boolean firstAddMember = true;
sbuf.append("add(");
for(int i=0; i<list.length; ++i) {
......
......@@ -76,7 +76,7 @@ public class SchedulingCtrBuilder {
// trivial case
if(stretchBeginIndex+widthMax >= list.length) return false;
// (l[i] == value && l[i]-1 != value) => (l[i+1] != value || ... || l[i+max] != value)
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append("imp(");
// COND part
if(stretchBeginIndex > 0) {
......@@ -105,7 +105,7 @@ public class SchedulingCtrBuilder {
return preventUnderLengthDueToBeginIndex(value, list, stretchBeginIndex);
}
// (l[i] == value && l[i]-1 != value) => (l[i+1] == value && ... && l[i+min-1] == value)
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append("imp(");
// COND part
if(stretchBeginIndex > 0) {
......@@ -127,7 +127,7 @@ public class SchedulingCtrBuilder {
}
private boolean preventUnderLengthDueToBeginIndex(int value, XVarInteger[] list, int stretchBeginIndex) {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
if(stretchBeginIndex > 0) {
sb.append("or(");
}
......@@ -153,7 +153,7 @@ public class SchedulingCtrBuilder {
String normVar1 = CtrBuilderUtils.normalizeCspVarName(list[i].id);
String normVar2 = CtrBuilderUtils.normalizeCspVarName(list[i+1].id);
String predExprCond = "ne("+normVar1+","+normVar2+")";
StringBuffer predExprImplBuf = new StringBuffer();
StringBuilder predExprImplBuf = new StringBuilder();
predExprImplBuf.append("or(");
predExprImplBuf.append("and(eq("+normVar1+","+Integer.toString(patterns[0][0])+"),eq("+normVar2+","+Integer.toString(patterns[0][1])+"))");
for(int j=1; j<patterns.length; ++j) {
......@@ -170,7 +170,7 @@ public class SchedulingCtrBuilder {
public boolean buildCtrCumulative(String id, XVarInteger[] origins, int[] lengths, int[] heights, Condition condition) {
int maxT = computeMaxT(origins, lengths);
for(int t=0; t<maxT; ++t) {
StringBuffer exprBuff = new StringBuffer();
StringBuilder exprBuff = new StringBuilder();
exprBuff.append("add(");
builtCtrCumulativeHeightComp(origins, 0, lengths, t, heights, exprBuff);
for(int i=1; i<origins.length; ++i) {
......@@ -185,14 +185,14 @@ public class SchedulingCtrBuilder {
}
private void builtCtrCumulativeHeightComp(XVarInteger[] origins, int originIndex, int[] lengths, int t,
int[] heights, StringBuffer exprBuff) {
int[] heights, StringBuilder exprBuff) {
exprBuff.append("ite(");
buildCtrCumulativeHeightCompCondition(origins, originIndex, lengths, t, exprBuff);
exprBuff.append(',').append(Integer.toString(heights[originIndex])).append(",0)");
}
private void builtCtrCumulativeHeightComp(XVarInteger[] origins, int originIndex, int[] lengths, int t,
XVarInteger[] heights, StringBuffer exprBuff) {
XVarInteger[] heights, StringBuilder exprBuff) {
exprBuff.append("ite(");
buildCtrCumulativeHeightCompCondition(origins, originIndex, lengths, t, exprBuff);
exprBuff.append(',');
......@@ -202,7 +202,7 @@ public class SchedulingCtrBuilder {
}
private void builtCtrCumulativeHeightComp(XVarInteger[] origins, int originIndex, XVarInteger[] lengths, int t,
int[] heights, StringBuffer exprBuff) { // TODO: some refactoring needed here (pass all arguments as text to common method
int[] heights, StringBuilder exprBuff) { // TODO: some refactoring needed here (pass all arguments as text to common method
exprBuff.append("ite(");
buildCtrCumulativeHeightCompCondition(origins, originIndex, lengths, t, exprBuff);
exprBuff.append(',');
......@@ -211,7 +211,7 @@ public class SchedulingCtrBuilder {
}
private void builtCtrCumulativeHeightComp(XVarInteger[] origins, int originIndex, XVarInteger[] lengths, int t,
XVarInteger[] heights, StringBuffer exprBuff) {
XVarInteger[] heights, StringBuilder exprBuff) {
exprBuff.append("ite(");
buildCtrCumulativeHeightCompCondition(origins, originIndex, lengths, t, exprBuff);
exprBuff.append(',');
......@@ -221,7 +221,7 @@ public class SchedulingCtrBuilder {
}
private void buildCtrCumulativeHeightCompCondition(XVarInteger[] origins, int originIndex, int[] lengths, int t,
StringBuffer exprBuff) {
StringBuilder exprBuff) {
// and(le(x,t),gt(add(x,l),t))
exprBuff.append("and(le(");
String normVar = CtrBuilderUtils.normalizeCspVarName(origins[originIndex].id);
......@@ -229,7 +229,7 @@ public class SchedulingCtrBuilder {
}
private void buildCtrCumulativeHeightCompCondition(XVarInteger[] origins, int originIndex, XVarInteger[] lengths,
int t, StringBuffer exprBuff) {
int t, StringBuilder exprBuff) {
// and(le(x,t),gt(add(x,l),t))
exprBuff.append("and(le(");