Package anderix.util

Class Datum

java.lang.Object
anderix.util.Datum

public class Datum extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    Datum(boolean theObject)
    Creates a Datum object that contains a boolean.
    Datum(byte theObject)
    Creates a Datum object that contains a byte.
    Datum(double theObject)
    Creates a Datum object that contains a double.
    Datum(float theObject)
    Creates a Datum object that contains a float.
    Datum(int theObject)
    Creates a Datum object that contains an int.
    Datum(long theObject)
    Creates a Datum object that contains a long.
    Datum(short theObject)
    Creates a Datum object that contains a boolean.
    Datum(Object theObject)
    Creates a Datum object that contains any Object.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Tests whether the internal object is a Boolean or not.
    boolean
    Tests whether the internal object is a Byte or not.
    boolean
    Tests whether the internal object is a Date or not.
    boolean
    Tests whether the internal object is a Double or not.
    boolean
    Tests whether the internal object is a Float or not.
    boolean
    Tests whether the internal object is an Integer or not.
    boolean
    Tests whether the internal object is a Long or not.
    boolean
    Tests whether the internal object is null or not.
    boolean
    Tests whether the internal object is a Short or not.
    boolean
    Tests whether the internal object is a String or not.
    boolean
    Converts the internal object to a boolean.
    byte
    Converts the internal object to a byte.
    Converts the internal object to a java.util.Date.
    double
    Converts the internal object to a double.
    float
    Converts the internal object to a float.
    int
    Converts the internal object to an int.
    long
    Converts the internal object to a long.
    Returns the internal object as an Object.
    short
    Converts the internal object to a short.
    Converts the internal object to a String object.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Datum

      public Datum(Object theObject)
      Creates a Datum object that contains any Object.
      Parameters:
      theObject - the Object to convert
    • Datum

      public Datum(int theObject)
      Creates a Datum object that contains an int.
      Parameters:
      theObject - the int to convert
    • Datum

      public Datum(boolean theObject)
      Creates a Datum object that contains a boolean.
      Parameters:
      theObject - the boolean to convert
    • Datum

      public Datum(short theObject)
      Creates a Datum object that contains a boolean.
      Parameters:
      theObject - the short to convert
    • Datum

      public Datum(long theObject)
      Creates a Datum object that contains a long.
      Parameters:
      theObject - the long to convert
    • Datum

      public Datum(float theObject)
      Creates a Datum object that contains a float.
      Parameters:
      theObject - the float to convert
    • Datum

      public Datum(double theObject)
      Creates a Datum object that contains a double.
      Parameters:
      theObject - the double to convert
    • Datum

      public Datum(byte theObject)
      Creates a Datum object that contains a byte.
      Parameters:
      theObject - the byte to convert
  • Method Details

    • toObject

      public Object toObject()
      Returns the internal object as an Object.
      Returns:
      the internal object as an Object
    • isNull

      public boolean isNull()
      Tests whether the internal object is null or not.
      Returns:
      true if the object is null; false otherwise
    • isString

      public boolean isString()
      Tests whether the internal object is a String or not.
      Returns:
      true if the object is of type String; false otherwise
    • isInt

      public boolean isInt()
      Tests whether the internal object is an Integer or not.
      Returns:
      true if the object is of type Integer; false otherwise
    • isDate

      public boolean isDate()
      Tests whether the internal object is a Date or not.
      Returns:
      true if the object is of type Date; false otherwise
    • isBoolean

      public boolean isBoolean()
      Tests whether the internal object is a Boolean or not.
      Returns:
      true if the object is of type Boolean; false otherwise
    • isShort

      public boolean isShort()
      Tests whether the internal object is a Short or not.
      Returns:
      true if the object is of type Short; false otherwise
    • isLong

      public boolean isLong()
      Tests whether the internal object is a Long or not.
      Returns:
      true if the object is of type Long; false otherwise
    • isFloat

      public boolean isFloat()
      Tests whether the internal object is a Float or not.
      Returns:
      true if the object is of type Float; false otherwise
    • isDouble

      public boolean isDouble()
      Tests whether the internal object is a Double or not.
      Returns:
      true if the object is of type Double; false otherwise
    • isByte

      public boolean isByte()
      Tests whether the internal object is a Byte or not.
      Returns:
      true if the object is of type Byte; false otherwise
    • toString

      public String toString()
      Converts the internal object to a String object. This conversion relies on the .toString() method of the object. If the object cannot be converted, an empty string is returned.
      Overrides:
      toString in class Object
      Returns:
      a String representation of the internal object
    • toInt

      public int toInt()
      Converts the internal object to an int. If the object cannot be converted, a value of 0 is returned.
      Returns:
      the internal object as an int
    • toDate

      public Date toDate()
      Converts the internal object to a java.util.Date. If the object cannot be converted, a value representing "the epoch", namely January 1, 1970, 00:00:00 GMT, is returned.
      Returns:
      the internal object as a Date
    • toBoolean

      public boolean toBoolean()
      Converts the internal object to a boolean.
      Returns:
      the internal object as a boolean If the object cannot be converted, a value of false is returned.
    • toShort

      public short toShort()
      Converts the internal object to a short. If the object cannot be converted, a value of 0 is returned.
      Returns:
      the internal object as a short
    • toLong

      public long toLong()
      Converts the internal object to a long. If the object cannot be converted, a value of 0 is returned.
      Returns:
      the internal object as a long
    • toFloat

      public float toFloat()
      Converts the internal object to a float. If the object cannot be converted, a value of 0 is returned.
      Returns:
      the internal object as a float
    • toDouble

      public double toDouble()
      Converts the internal object to a double. If the object cannot be converted, a value of 0 is returned.
      Returns:
      the internal object as a double
    • toByte

      public byte toByte()
      Converts the internal object to a byte. If the object cannot be converted, a value of 0 is returned.
      Returns:
      the internal object as a byte