Package jnr.ffi

Class Struct.NumberField

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int offset
      Offset from the start of the Struct memory this field is located at.
      protected Type type  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      byte byteValue()
      Returns a byte representation of this Number.
      double doubleValue()
      Returns an float representation of this Number.
      float floatValue()
      Returns an float representation of this Number.
      Pointer getMemory()
      Gets the memory object used to store this Member
      abstract int intValue()
      Returns a int representation of this Number.
      long longValue()
      Returns a long representation of this Number.
      long offset()
      Gets the offset within the structure for this field.
      abstract void set​(java.lang.Number value)
      Sets the field to a new value.
      short shortValue()
      Returns a short representation of this Number.
      Struct struct()
      Gets the Struct this Member is in.
      java.lang.String toString()
      Returns a string representation of this Number.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • offset

        private final int offset
        Offset from the start of the Struct memory this field is located at.
      • type

        protected final Type type
    • Method Detail

      • struct

        public final Struct struct()
        Gets the Struct this Member is in.
        Specified by:
        struct in class Struct.Member
        Returns:
        a Struct.
      • offset

        public final long offset()
        Gets the offset within the structure for this field.
        Specified by:
        offset in class Struct.Member
        Returns:
        the offset within the structure for this field.
      • set

        public abstract void set​(java.lang.Number value)
        Sets the field to a new value.
        Parameters:
        value - The new value.
      • doubleValue

        public double doubleValue()
        Returns an float representation of this Number.
        Returns:
        an float value for this Number.
      • floatValue

        public float floatValue()
        Returns an float representation of this Number.
        Returns:
        an float value for this Number.
      • byteValue

        public byte byteValue()
        Returns a byte representation of this Number.
        Returns:
        a byte value for this Number.
      • shortValue

        public short shortValue()
        Returns a short representation of this Number.
        Returns:
        a short value for this Number.
      • intValue

        public abstract int intValue()
        Returns a int representation of this Number.
        Returns:
        a int value for this Number.
      • longValue

        public long longValue()
        Returns a long representation of this Number.
        Returns:
        a long value for this Number.
      • toString

        public java.lang.String toString()
        Returns a string representation of this Number.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this Number.