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

Method parseFixedPoint

src/main/java/core/org/xbill/DNS/LOCRecord.java:76–91  ·  view source on GitHub ↗
(String s)

Source from the content-addressed store, hash-verified

74}
75
76private double
77parseFixedPoint(String s)
78{
79 if (s.matches("^-?\\d+$"))
80 return Integer.parseInt(s);
81 else if (s.matches("^-?\\d+\\.\\d*$")) {
82 String [] parts = s.split("\\.");
83 double value = Integer.parseInt(parts[0]);
84 double fraction = Integer.parseInt(parts[1]);
85 if (value < 0)
86 fraction *= -1;
87 int digits = parts[1].length();
88 return value + (fraction / Math.pow(10, digits));
89 } else
90 throw new NumberFormatException();
91}
92
93private long
94parsePosition(Tokenizer st, String type) throws IOException {

Callers 2

parsePositionMethod · 0.95
parseDoubleMethod · 0.95

Calls 2

lengthMethod · 0.80
matchesMethod · 0.45

Tested by

no test coverage detected