Class UInt8

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

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

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

    Constructors
    Constructor
    Description
    UInt8(short s)
    Create an unsigned 8-bit integer from a short dataValue
    Create an unsigned 8-bit integer
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Return the dataValue of this unsigned 8-bit integer as a double dataValue
    boolean
     
    float
     
    int
     
    int
    Return the dataValue of this unsigned 8-bit integer as an integer dataValue
    long
    Return the dataValue of this unsigned 8-bit integer as a long dataValue
    short
    Return the dataValue of this unsigned 8-bit integer as a short dataValue
     

    Methods inherited from class java.lang.Number

    byteValue

    Methods inherited from class java.lang.Object

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

    • MAX_VALUE

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

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

    • UInt8

      public UInt8(String val)
      Create an unsigned 8-bit integer
      Parameters:
      val - - string containing an unsigned 8 bit integer 0 <= dataValue < 2^8
    • UInt8

      public UInt8(short s)
      Create an unsigned 8-bit integer from a short dataValue
      Parameters:
      s - - short dataValue containing an unsigned 8-bit integer 0 <= dataValue < 2^8
  • Method Details

    • shortValue

      public short shortValue()
      Return the dataValue of this unsigned 8-bit integer as a short dataValue
      Overrides:
      shortValue in class Number
      Returns:
      - short containing dataValue
    • intValue

      public int intValue()
      Return the dataValue of this unsigned 8-bit integer as an integer dataValue
      Specified by:
      intValue in class Number
      Returns:
      - int containing dataValue
    • longValue

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

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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

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

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

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