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