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

UnsignedLong

public class UnsignedLong extends Number implements Comparable
Custom class for supporting primitive XSD data type UnsignedLong
author
Chris Haddad
see
XML Schema 3.3.21

Fields Summary
protected BigInteger
lValue
private static BigInteger
MAX
private Object
__equalsCalc
Constructors Summary
public UnsignedLong()

 // max unsigned long

      
    
public UnsignedLong(double value)

        setValue(new BigInteger(Double.toString(value)));
    
public UnsignedLong(BigInteger value)

        setValue(value);
    
public UnsignedLong(long lValue)

        setValue(BigInteger.valueOf(lValue));
    
public UnsignedLong(String stValue)

        setValue(new BigInteger(stValue));
    
Methods Summary
public bytebyteValue()

        return lValue.byteValue();
    
public intcompareTo(java.lang.Object obj)

        if (lValue != null)
            return lValue.compareTo(obj);
        else if (equals(obj) == true)
            return 0;  // null == null
        else
            return 1;  // object is greater
    
public doubledoubleValue()

        return lValue.doubleValue();
    
public synchronized booleanequals(java.lang.Object obj)


         
        if (!(obj instanceof UnsignedLong)) return false;
        UnsignedLong other = (UnsignedLong) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
                ((lValue == null && other.lValue == null) ||
                (lValue != null &&
                lValue.equals(other.lValue)));
        __equalsCalc = null;
        return _equals;
    
public floatfloatValue()

        return lValue.floatValue();
    
public inthashCode()

        if (lValue != null)
            return lValue.hashCode();
        else
            return 0;
    
public intintValue()

        return lValue.intValue();
    
public static booleanisValid(java.math.BigInteger value)

        if (value.compareTo(BigInteger.ZERO) == -1 || // less than zero
                value.compareTo(MAX) == 1) {
            return false;
        }
        return true;
    
public longlongValue()

        return lValue.longValue();
    
private voidsetValue(java.math.BigInteger val)

        if (!UnsignedLong.isValid(val)) {
            throw new NumberFormatException(Messages.getMessage(
                    "badUnsignedLong00") +
                    String.valueOf(val) + "]");
        }
        this.lValue = val;
    
public shortshortValue()

        return lValue.shortValue();
    
public java.lang.StringtoString()

        return lValue.toString();