Example #1
0
 @Override
 public Integer value(ByteSearchSection section) {
   if (section.notEmpty()) {
     try {
       return Integer.parseInt(stringValue(section));
     } catch (NumberFormatException ex) {
       log.fatalexception(
           ex,
           "value() offset %d section %s",
           StructuredTextFile.this.datafile.getOffset(),
           section.reportString());
     }
   }
   return 0;
 }
Example #2
0
 @Override
 public double[] value(ByteSearchSection section) {
   double[] result = ArrayTools.emptyDoubleArray;
   if (section.notEmpty()) {
     String stringvalue = stringValue(section);
     if (stringvalue.length() > 0) {
       try {
         String part[] = stringvalue.split(",");
         result = new double[part.length];
         for (int i = 0; i < part.length; i++) {
           result[i] = Double.parseDouble(part[i]);
         }
       } catch (NumberFormatException ex) {
         log.fatalexception(
             ex,
             "value() offset %d section %s",
             StructuredTextFile.this.datafile.getOffset(),
             section.reportString());
       }
     }
   }
   return result;
 }