NonPositiveIntegerpublic class NonPositiveInteger extends BigInteger Custom class for supporting primitive XSD data type nonPositiveInteger
nonPositiveInteger is derived from integer by setting the value of
maxInclusive to be 0. This results in the standard mathematical
concept of the non-positive integers. The value space of
nonPositiveInteger is the infinite set {...,-2,-1,0}. |
Fields Summary |
---|
private BigInteger | zerovalidate the value against the xsd definition |
Constructors Summary |
---|
public NonPositiveInteger(byte[] val)
super(val);
checkValidity();
| public NonPositiveInteger(int signum, byte[] magnitude)
super(signum, magnitude);
checkValidity();
| public NonPositiveInteger(int bitLength, int certainty, Random rnd)
super(bitLength, certainty, rnd);
checkValidity();
| public NonPositiveInteger(int numBits, Random rnd)
super(numBits, rnd);
checkValidity();
| public NonPositiveInteger(String val)
super(val);
checkValidity();
| public NonPositiveInteger(String val, int radix)
super(val, radix);
checkValidity();
|
Methods Summary |
---|
private void | checkValidity()
if (compareTo(zero) > 0) {
throw new NumberFormatException(
Messages.getMessage("badNonPosInt00")
+ ": " + this);
}
| public java.lang.Object | writeReplace()Work-around for http://developer.java.sun.com/developer/bugParade/bugs/4378370.html
return new BigIntegerRep(toByteArray());
|
|