Class UInt32

java.lang.Object
java.lang.Number
net.aifusion.metamodel.UInt32
All Implemented Interfaces:
Serializable

public class UInt32 extends Number implements Serializable
Class to represent an unsigned 32-bit integer
Author:
Sharad Singhal
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    maximum dataValue possible for the unsigned integer
    static final long
    minimum dataValue possible for the unsigned integer
  • Constructor Summary

    Constructors
    Constructor
    Description
    UInt32(long val)
    Create an unsigned 32 number from a long dataValue
    Create an unsigned 64 number from a string
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Return the dataValue of this unsigned integer as a double dataValue
    boolean
    Compares this unsigned 64-bit integer object with the specified object for equality
    float
     
    int
     
    int
     
    long
    Return the dataValue of this unsigned integer as a long dataValue
     

    Methods inherited from class java.lang.Number

    byteValue, shortValue

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • MAX_VALUE

      public static final long MAX_VALUE
      maximum dataValue possible for the unsigned integer
      See Also:
    • MIN_VALUE

      public static final long MIN_VALUE
      minimum dataValue possible for the unsigned integer
      See Also:
  • Constructor Details

    • UInt32

      public UInt32(long val)
      Create an unsigned 32 number from a long dataValue
      Parameters:
      val - - dataValue for this unsigned integer. Must be 0 <= val < 2^32
    • UInt32

      public UInt32(String val)
      Create an unsigned 64 number from a string
      Parameters:
      val - - input string containing integer dataValue 0 <= val < 2^32
  • Method Details

    • longValue

      public long longValue()
      Return the dataValue of this unsigned integer as a long dataValue
      Specified by:
      longValue in class Number
      Returns:
      dataValue of the integer
    • doubleValue

      public double doubleValue()
      Return the dataValue of this unsigned integer as a double dataValue
      Specified by:
      doubleValue in class Number
      Returns:
      - double dataValue containing this unsigned integer
    • equals

      public boolean equals(Object o)
      Compares this unsigned 64-bit integer object with the specified object for equality
      Overrides:
      equals in class Object
      Parameters:
      o - the object to compare
      Returns:
      true if the specified object is an unsigned 64-bit integer object. Otherwise, false.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • intValue

      public int intValue()
      Specified by:
      intValue in class Number
    • floatValue

      public float floatValue()
      Specified by:
      floatValue in class Number