Exemplo n.º 1
0
 private void addConstraint(String line, Section actualSection) {
   if (actualSection != null) {
     List<String> split = reworkLine(line);
     List<Constraint> constraints = actualSection.getConstraints();
     ConstraintImpl c = new ConstraintImpl();
     int length = split.size();
     if (length >= 4) {
       c.setAi(split.get(0));
       c.setAj(split.get(1));
       c.setFuncType(Integer.parseInt(split.get(2)));
       c.setC1(new BigDecimal(split.get(3)));
     }
     if (length == 5) {
       c.setC2(new BigDecimal(split.get(4)));
     }
     if (length < 4 || length > 5) {
       ch.printErrorln(String.format("some CONSTRAINTS values are lost! --> %s", line));
     } else {
       constraints.add(c);
     }
   }
 }