Пример #1
0
 private void addConstraintType(String line) {
   List<String> split = reworkLine(line);
   List<Constraint> constraintTypes = structure.getConstraintTypes();
   ConstraintImpl ct = new ConstraintImpl();
   int length = split.size();
   if (length >= 4) {
     ct.setAi(split.get(0));
     ct.setAj(split.get(1));
     ct.setFuncType(Integer.parseInt(split.get(2)));
     ct.setC1(new BigDecimal(split.get(3)));
   }
   if (length == 5) {
     ct.setC2(new BigDecimal(split.get(4)));
   }
   if (length < 4 || length > 5) {
     ch.printErrorln(String.format("some CONSTRAINTTYPES values are lost! --> %s", line));
   } else {
     constraintTypes.add(ct);
   }
 }
Пример #2
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);
     }
   }
 }