MCPcopy Create free account
hub / github.com/DeNA/PacketProxy / parseDouble

Method parseDouble

src/main/java/core/org/xbill/DNS/LOCRecord.java:134–158  ·  view source on GitHub ↗
(Tokenizer st, String type, boolean required, long min, long max,
	    long defaultValue)

Source from the content-addressed store, hash-verified

132}
133
134private long
135parseDouble(Tokenizer st, String type, boolean required, long min, long max,
136 long defaultValue)
137throws 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
160void
161rdataFromString(Tokenizer st, Name origin) throws IOException {

Callers 4

rdataFromStringMethod · 0.95
getLongitudeMethod · 0.80
getLatitudeMethod · 0.80
getAltitudeMethod · 0.80

Calls 6

parseFixedPointMethod · 0.95
isEOLMethod · 0.80
exceptionMethod · 0.80
ungetMethod · 0.80
lengthMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected