MCPcopy Create free account
hub / github.com/antlr/codebuff / BigIntegerDomain

Class BigIntegerDomain

output/java_guava/1.4.16/DiscreteDomain.java:173–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171 }
172
173 private static final class BigIntegerDomain extends DiscreteDomain<BigInteger> implements Serializable {
174 private static final BigIntegerDomain INSTANCE = new BigIntegerDomain();
175 private static final BigInteger MIN_LONG = BigInteger.valueOf(Long.MIN_VALUE);
176 private static final BigInteger MAX_LONG = BigInteger.valueOf(Long.MAX_VALUE);
177
178 @Override
179 public BigInteger next(BigInteger value) {
180 return value.add(BigInteger.ONE);
181 }
182
183 @Override
184 public BigInteger previous(BigInteger value) {
185 return value.subtract(BigInteger.ONE);
186 }
187
188 @Override
189 public long distance(BigInteger start, BigInteger end) {
190 return end.subtract(start).max(MIN_LONG).min(MAX_LONG).longValue();
191 }
192
193 private Object readResolve() {
194 return INSTANCE;
195 }
196
197 @Override
198 public String toString() {
199 return "DiscreteDomain.bigIntegers()";
200 }
201
202 private static final long serialVersionUID = 0;
203 }
204
205 /** Constructor for use by subclasses. */
206

Callers

nothing calls this directly

Calls 1

valueOfMethod · 0.45

Tested by

no test coverage detected