(Tokenizer st, String type, boolean required, long min, long max, long defaultValue)
| 132 | } |
| 133 | |
| 134 | private long |
| 135 | parseDouble(Tokenizer st, String type, boolean required, long min, long max, |
| 136 | long defaultValue) |
| 137 | throws IOException |
| 138 | { |
| 139 | Tokenizer.Token token = st.get(); |
| 140 | if (token.isEOL()) { |
| 141 | if (required) |
| 142 | throw st.exception("Invalid LOC " + type); |
| 143 | st.unget(); |
| 144 | return defaultValue; |
| 145 | } |
| 146 | String s = token.value; |
| 147 | if (s.length() > 1 && s.charAt(s.length() - 1) == 'm') |
| 148 | s = s.substring(0, s.length() - 1); |
| 149 | try { |
| 150 | long value = (long)(100 * parseFixedPoint(s)); |
| 151 | if (value < min || value > max) |
| 152 | throw st.exception("Invalid LOC " + type); |
| 153 | return value; |
| 154 | } |
| 155 | catch (NumberFormatException e) { |
| 156 | throw st.exception("Invalid LOC " + type); |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | void |
| 161 | rdataFromString(Tokenizer st, Name origin) throws IOException { |
no test coverage detected