1 16 17 package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements; 18 19 import org.apache.cocoon.components.elementprocessor.types.NumericConverter; 20 import org.apache.cocoon.components.elementprocessor.types.NumericResult; 21 22 import java.io.IOException ; 23 24 35 public class EPSolver extends BaseElementProcessor { 36 private NumericResult _target_row; 37 private NumericResult _target_col; 38 private NumericResult _problem_type; 39 private String _inputs; 40 private static final String _target_row_attribute = "TargetRow"; 41 private static final String _target_col_attribute = "TargetCol"; 42 private static final String _problem_type_attribute = "ProblemType"; 43 private static final String _inputs_attribute = "Inputs"; 44 45 48 public EPSolver() { 49 super(null); 50 _target_row = null; 51 _target_col = null; 52 _problem_type = null; 53 _inputs = null; 54 } 55 56 60 public int getTargetCol() throws IOException { 61 if (_target_col == null) { 62 _target_col = NumericConverter.extractInteger( 63 getValue(_target_col_attribute)); 64 } 65 return _target_col.intValue(); 66 } 67 68 72 public int getTargetRow() throws IOException { 73 if (_target_row == null) { 74 _target_row = NumericConverter.extractInteger( 75 getValue(_target_row_attribute)); 76 } 77 return _target_row.intValue(); 78 } 79 80 84 public int getProblemType() throws IOException { 85 if (_problem_type == null) { 86 _problem_type = NumericConverter.extractInteger( 87 getValue(_problem_type_attribute)); 88 } 89 return _problem_type.intValue(); 90 } 91 92 95 public String getInputs() { 96 if (_inputs == null) { 97 String value = getValue(_inputs_attribute); 98 99 _inputs = (value == null) ? "" : value.trim(); 100 } 101 return _inputs; 102 } 103 } | Popular Tags |