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

Class IntThing

  • All Implemented Interfaces:
    RealThing


    public class IntThing
    extends IntegralThing
    The IntThing class represents an integer Thing.
    • Constructor Summary

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

      • IntThing

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

        public IntThing(int i)
        Creates a new IntThing instance with value i.
        Parameters:
        i - an int value
      • IntThing

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

        public IntThing(java.lang.String s)
        Creates a new IntThing instance from string s.
        Parameters:
        s - a String value
    • Method Detail

      • thingclass

        public java.lang.String thingclass()
      • create

        public static Thing create(int i)
        The create method creates and returns a newly allocated Thing with an IntThing internal representation.
        Parameters:
        i - an int value
        Returns:
        a Thing value
      • create

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

        public static int get(Thing thing)
                       throws HeclException
        get attempts to fetch an integer value from a Thing.
        Parameters:
        thing - a Thing value
        Returns:
        an int 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(int i)
        set sets the internal value of an IntThing to i.
        Parameters:
        i - an int value
      • getStringRep

        public java.lang.String getStringRep()
        getStringRep creates a string representation of the IntThing.
        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.