Documentation of 'org.hecl.DoubleThing' Java class
DoubleThing
org.hecl

Class DoubleThing

  • All Implemented Interfaces:
    RealThing


    public class DoubleThing
    extends FractionalThing
    The DoubleThing class represents a Thing that contains a double value.
    • Constructor Summary

      Constructors 
      Constructor and Description
      DoubleThing()
      Creates a new DoubleThing instance equal to 0.
      DoubleThing(boolean b)
      Creates a new DoubleThing instance from boolean b where true is 1 and false is 0.
      DoubleThing(double d)
      Creates a new DoubleThing instance with value i.
      DoubleThing(java.lang.String s)
      Creates a new DoubleThing instance from string s.
    • Constructor Detail

      • DoubleThing

        public DoubleThing()
        Creates a new DoubleThing instance equal to 0.
      • DoubleThing

        public DoubleThing(double d)
        Creates a new DoubleThing instance with value i.
        Parameters:
        d - a double value
      • DoubleThing

        public DoubleThing(boolean b)
        Creates a new DoubleThing instance from boolean b where true is 1 and false is 0.
        Parameters:
        b - a boolean value
      • DoubleThing

        public DoubleThing(java.lang.String s)
                    throws java.lang.NumberFormatException
        Creates a new DoubleThing instance from string s.
        Parameters:
        s - a String value
        Throws:
        java.lang.NumberFormatException - when argum,ent does not adhere to floating point number syntax.
    • Method Detail

      • thingclass

        public java.lang.String thingclass()
      • create

        public static Thing create(double d)
        The create method creates and returns a newly allocated Thing with a DoubleThing internal representation.
        Parameters:
        d - a double value
        Returns:
        a Thing value
      • create

        public static Thing create(boolean b)
        The create method creates and returns a newly allocated Thing with a DoubleThing internal representation.
        Parameters:
        b - an boolean value
        Returns:
        a Thing value
      • get

        public static double get(Thing thing)
                          throws HeclException
        get attempts to fetch a double value from a Thing.
        Parameters:
        thing - a Thing value
        Returns:
        a double value
        Throws:
        HeclException - if an error occurs
      • byteValue

        public byte byteValue()
        Description copied from class: NumberThing
        byteValue returns the number as a byte.
        Specified by:
        byteValue in class NumberThing
        Returns:
        a byte value
      • shortValue

        public short shortValue()
        Description copied from class: NumberThing
        shortValue returns the number as a short.
        Specified by:
        shortValue in class NumberThing
        Returns:
        a short value
      • intValue

        public int intValue()
        Description copied from class: NumberThing
        intValue returns the number as an int.
        Specified by:
        intValue in class NumberThing
        Returns:
        an int value
      • longValue

        public long longValue()
        Description copied from class: NumberThing
        longValue returns the value as a long.
        Specified by:
        longValue in class NumberThing
        Returns:
        a long value
      • floatValue

        public float floatValue()
        Description copied from class: NumberThing
        floatValue returns the value as a float. Not available in CLDC 1.0
        Specified by:
        floatValue in class NumberThing
        Returns:
        a float value
      • doubleValue

        public double doubleValue()
        Description copied from class: NumberThing
        doubleValue returns the value as a double. Not available in CLDC 1.0
        Specified by:
        doubleValue in class NumberThing
        Returns:
        a double value
      • set

        public void set(double d)
        set sets the internal value of a DoubleThing to i.
        Parameters:
        d - a double value
      • getStringRep

        public java.lang.String getStringRep()
        getStringRep creates a string representation of the DoubleThing.
        Specified by:
        getStringRep in interface RealThing
        Specified by:
        getStringRep in class NumberThing
        Returns:
        a String value

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.