Example #1
0
 private void addPairType(String line) {
   List<String> split = reworkLine(line);
   List<Pair> pairTypes = structure.getPairTypes();
   PairImpl pt = new PairImpl();
   int length = split.size();
   if (length >= 3) {
     pt.setAi(split.get(0));
     pt.setAj(split.get(1));
     pt.setFuncType(Integer.parseInt(split.get(2)));
   }
   if (length >= 5) {
     pt.setC1(new BigDecimal(split.get(3)));
     pt.setC2(new BigDecimal(split.get(4)));
   }
   if (length >= 7) {
     pt.setC3(new BigDecimal(split.get(5)));
     pt.setC4(new BigDecimal(split.get(6)));
   }
   if (length == 8) {
     pt.setC5(new BigDecimal(split.get(7)));
   }
   if (length < 3 || length > 8) {
     ch.printErrorln(String.format("some PAIRTYPES values are lost! --> %s", line));
   } else {
     pairTypes.add(pt);
   }
 }
Example #2
0
 private void addPair(String line, Section actualSection) {
   if (actualSection != null) {
     List<Pair> pairs = actualSection.getPairs();
     List<String> split = reworkLine(line);
     PairImpl p = new PairImpl();
     int length = split.size();
     if (length >= 3) {
       p.setAi(split.get(0));
       p.setAj(split.get(1));
       p.setFuncType(Integer.parseInt(split.get(2)));
     }
     if (length >= 5) {
       p.setC1(new BigDecimal(split.get(3)));
       p.setC2(new BigDecimal(split.get(4)));
     }
     if (length >= 7) {
       p.setC3(new BigDecimal(split.get(5)));
       p.setC4(new BigDecimal(split.get(6)));
     }
     if (length == 8) {
       p.setC5(new BigDecimal(split.get(7)));
     }
     if (length < 3 || length > 8) {
       ch.printErrorln(String.format("some PAIRS values are lost! --> %s", line));
     } else {
       pairs.add(p);
     }
   }
 }