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

NonNegativeInteger

public class NonNegativeInteger extends BigInteger
Custom class for supporting primitive XSD data type nonNegativeInteger
author
Russell Butek
see
XML Schema 3.3.20

Fields Summary
private BigInteger
zero
validate the value against the xsd definition
Constructors Summary
public NonNegativeInteger(byte[] val)

        super(val);
        checkValidity();
    
public NonNegativeInteger(int signum, byte[] magnitude)

        super(signum, magnitude);
        checkValidity();
    
public NonNegativeInteger(int bitLength, int certainty, Random rnd)

        super(bitLength, certainty, rnd);
        checkValidity();
    
public NonNegativeInteger(int numBits, Random rnd)

        super(numBits, rnd);
        checkValidity();
    
public NonNegativeInteger(String val)

        super(val);
        checkValidity();
    
public NonNegativeInteger(String val, int radix)

        super(val, radix);
        checkValidity();
    
Methods Summary
private voidcheckValidity()

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

return
BigIntegerRep
throws
ObjectStreamException

        return new BigIntegerRep(toByteArray());