FileDocCategorySizeDatePackage
UnsignedInt.javaAPI DocApache Axis 1.43675Sat Apr 22 18:57:28 BST 2006org.apache.axis.types

UnsignedInt

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

Fields Summary
protected Long
lValue
private Object
__equalsCalc
Constructors Summary
public UnsignedInt()


      
    
public UnsignedInt(long iValue)
ctor for UnsignedInt

exception
NumberFormatException will be thrown if validation fails

      setValue(iValue);
    
public UnsignedInt(String stValue)

      setValue(Long.parseLong(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 UnsignedInt)) return false;
        UnsignedInt other = (UnsignedInt) 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(long iValue)
validate the value against the xsd definition

      if ( (iValue < 0L)  || (iValue > 4294967295L))
        return false;
      else
        return true;
    
public longlongValue()

 return lValue.longValue(); 
public voidsetValue(long iValue)
validates the data and sets the value for the object.

param
iValue value

      if (UnsignedInt.isValid(iValue) == false)
            throw new NumberFormatException(
                    Messages.getMessage("badUnsignedInt00") +
                    String.valueOf(iValue) + "]");
      lValue = new Long(iValue);
    
public shortshortValue()

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

      if (lValue != null)
        return lValue.toString();
      else
        return null;