FileDocCategorySizeDatePackage
NegativeInteger.javaAPI DocApache Axis 1.43141Sat Apr 22 18:57:26 BST 2006org.apache.axis.types

NegativeInteger

public 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.
author
Chris Haddad
see
XML Schema 3.3.15

Fields Summary
private BigInteger
zero
validate 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 voidcheckValidity()

       
        if (compareTo(zero) >= 0) {
            throw new NumberFormatException(
                    Messages.getMessage("badnegInt00")
                    + ":  " + this);
        }
    
public java.lang.ObjectwriteReplace()
Work-around for http://developer.java.sun.com/developer/bugParade/bugs/4378370.html

return
BigIntegerRep
throws
java.io.ObjectStreamException

        return new BigIntegerRep(toByteArray());