Class UInt16

java.lang.Object
java.lang.Number
org.freedesktop.dbus.UInt16
All Implemented Interfaces:
Serializable, Comparable<UInt16>

public class UInt16 extends Number implements Comparable<UInt16>
Class to represent 16-bit unsigned integers.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Maximum possible value.
    static final int
    Minimum possible value.
  • Constructor Summary

    Constructors
    Constructor
    Description
    UInt16(int value)
    Create a UInt16 from an int.
    UInt16(String value)
    Create a UInt16 from a String.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte
    The value of this as a byte.
    int
    Compare two UInt16s.
    double
    The value of this as a double.
    boolean
    Test two UInt16s for equality.
    float
    The value of this as a float.
    int
     
    int
    The value of this as a int.
    long
    The value of this as a long.
    short
    The value of this as a short.
    The value of this as a string.

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • UInt16

      public UInt16(int value)
      Create a UInt16 from an int.
      Parameters:
      value - Must be within MIN_VALUE–MAX_VALUE
      Throws:
      NumberFormatException - if value is not between MIN_VALUE and MAX_VALUE
    • UInt16

      public UInt16(String value)
      Create a UInt16 from a String.
      Parameters:
      value - Must parse to a valid integer within MIN_VALUE–MAX_VALUE
      Throws:
      NumberFormatException - if value is not an integer between MIN_VALUE and MAX_VALUE
  • Method Details

    • byteValue

      public byte byteValue()
      The value of this as a byte.
      Overrides:
      byteValue in class Number
    • doubleValue

      public double doubleValue()
      The value of this as a double.
      Specified by:
      doubleValue in class Number
    • floatValue

      public float floatValue()
      The value of this as a float.
      Specified by:
      floatValue in class Number
    • intValue

      public int intValue()
      The value of this as a int.
      Specified by:
      intValue in class Number
    • longValue

      public long longValue()
      The value of this as a long.
      Specified by:
      longValue in class Number
    • shortValue

      public short shortValue()
      The value of this as a short.
      Overrides:
      shortValue in class Number
    • equals

      public boolean equals(Object o)
      Test two UInt16s for equality.
      Overrides:
      equals in class Object
    • hashCode

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

      public int compareTo(UInt16 other)
      Compare two UInt16s.
      Specified by:
      compareTo in interface Comparable<UInt16>
      Returns:
      0 if equal, -ve or +ve if they are different.
    • toString

      public String toString()
      The value of this as a string.
      Overrides:
      toString in class Object