Documentation of 'org.freehep.util.Value' Java class
Value
org.freehep.util

Class Value



  • public class Value
    extends java.lang.Object
    A class that can represent any Java object or primitive. Unlike the built-in primitive proxies (Double, Integer etc) it is mutable. It is used to allow values to be used without needing overloaded methods for each primitive type, and without the overhead of object creation/deletion. When a value is returned by an Object method it should be assumed to be valid only until the next method call to that Object. The use of Value should be avoided in multi-threaded environments.
    • Constructor Summary

      Constructors 
      Constructor and Description
      Value() 
      Value(Value v) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      Value fromExternal(java.lang.String external)
      Set to value from the external respresentation
      boolean getBoolean()
      Get the boolean value.
      byte getByte()
      Get the byte value.
      char getChar()
      Get the char value.
      java.util.Date getDate()
      Get the Date value.
      double getDouble()
      Get the double value.
      float getFloat()
      Get the float value.
      int getInt()
      Get the integer value.
      long getLong()
      Get the long value.
      java.lang.Object getObject()
      Get the Object value.
      short getShort()
      Get the short value.
      java.lang.String getString()
      Get the String value.
      java.lang.Class getType()
      Get the Value's type
      Value set(boolean val)
      Set the Value's internal value to a boolean.
      Value set(byte val)
      Set the Value's internal value to a byte.
      Value set(char val)
      Set the Value's internal value to a char.
      Value set(java.util.Date val)
      Set the Value's internal value to a Date.
      Value set(double val)
      Set the Value's internal value to a double.
      Value set(float val)
      Set the Value's internal value to a float.
      Value set(int val)
      Set the Value's internal value to an integer.
      Value set(long val)
      Set the Value's internal value to a long.
      Value set(java.lang.Object val)
      Set the Value's internal value to an Object.
      Value set(short val)
      Set the Value's internal value to a short.
      Value set(java.lang.String val)
      Set the Value's internal value to a String.
      Value setValue(Value v) 
      java.lang.String toExternal()
      Returns an external representation of this value
      java.lang.String toString()
      Get the String value.
      • Methods inherited from class java.lang.Object

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

      • TYPE_INTEGER

        public static final java.lang.Class TYPE_INTEGER
      • TYPE_SHORT

        public static final java.lang.Class TYPE_SHORT
      • TYPE_LONG

        public static final java.lang.Class TYPE_LONG
      • TYPE_FLOAT

        public static final java.lang.Class TYPE_FLOAT
      • TYPE_DOUBLE

        public static final java.lang.Class TYPE_DOUBLE
      • TYPE_BOOLEAN

        public static final java.lang.Class TYPE_BOOLEAN
      • TYPE_BYTE

        public static final java.lang.Class TYPE_BYTE
      • TYPE_CHAR

        public static final java.lang.Class TYPE_CHAR
      • TYPE_STRING

        public static final java.lang.Class TYPE_STRING
      • TYPE_DATE

        public static final java.lang.Class TYPE_DATE
    • Constructor Detail

      • Value

        public Value()
      • Value

        public Value(Value v)
    • Method Detail

      • getType

        public java.lang.Class getType()
        Get the Value's type
        Returns:
        The Class of this Value.
      • set

        public Value set(int val)
        Set the Value's internal value to an integer.
        Parameters:
        val - The integer value.
        Returns:
        The Value object with the given internal value.
      • set

        public Value set(short val)
        Set the Value's internal value to a short.
        Parameters:
        val - The short value.
        Returns:
        The Value object with the given internal value.
      • set

        public Value set(long val)
        Set the Value's internal value to a long.
        Parameters:
        val - The long value.
        Returns:
        The Value object with the given internal value.
      • set

        public Value set(float val)
        Set the Value's internal value to a float.
        Parameters:
        val - The float value.
        Returns:
        The Value object with the given internal value.
      • set

        public Value set(double val)
        Set the Value's internal value to a double.
        Parameters:
        val - The double value.
        Returns:
        The Value object with the given internal value.
      • set

        public Value set(boolean val)
        Set the Value's internal value to a boolean.
        Parameters:
        val - The boolean value.
        Returns:
        The Value object with the given internal value.
      • set

        public Value set(byte val)
        Set the Value's internal value to a byte.
        Parameters:
        val - The byte value.
        Returns:
        The Value object with the given internal value.
      • set

        public Value set(char val)
        Set the Value's internal value to a char.
        Parameters:
        val - The char value.
        Returns:
        The Value object with the given internal value.
      • set

        public Value set(java.lang.String val)
        Set the Value's internal value to a String.
        Parameters:
        val - The String value.
        Returns:
        The Value object with the given internal value.
      • set

        public Value set(java.util.Date val)
        Set the Value's internal value to a Date.
        Parameters:
        val - The Date value.
        Returns:
        The Value object with the given internal value.
      • set

        public Value set(java.lang.Object val)
        Set the Value's internal value to an Object.
        Parameters:
        val - The Object value.
        Returns:
        The Value object with the given internal value.
      • getInt

        public int getInt()
        Get the integer value.
        Returns:
        The int value.
        Throws:
        A - ClassCastException is thrown if this Value has incompatible type.
      • getShort

        public short getShort()
        Get the short value.
        Returns:
        The short value.
        Throws:
        A - ClassCastException is thrown if this Value has incompatible type.
      • getLong

        public long getLong()
        Get the long value.
        Returns:
        The long value.
        Throws:
        A - ClassCastException is thrown if this Value has incompatible type.
      • getFloat

        public float getFloat()
        Get the float value.
        Returns:
        The float value.
        Throws:
        A - ClassCastException is thrown if this Value has incompatible type.
      • getDouble

        public double getDouble()
        Get the double value.
        Returns:
        The double value.
        Throws:
        A - ClassCastException is thrown if this Value has incompatible type.
      • getBoolean

        public boolean getBoolean()
        Get the boolean value.
        Returns:
        The boolean value.
        Throws:
        A - ClassCastException is thrown if this Value has incompatible type.
      • getByte

        public byte getByte()
        Get the byte value.
        Returns:
        The byte value.
        Throws:
        A - ClassCastException is thrown if this Value has incompatible type.
      • getChar

        public char getChar()
        Get the char value.
        Returns:
        The char value.
        Throws:
        A - ClassCastException is thrown if this Value has incompatible type.
      • getString

        public java.lang.String getString()
        Get the String value.
        Returns:
        The String representation of the internal value.
      • getDate

        public java.util.Date getDate()
        Get the Date value.
        Returns:
        The Date value.
        Throws:
        A - ClassCastException is thrown if this Value has incompatible type.
      • getObject

        public java.lang.Object getObject()
        Get the Object value.
        Returns:
        The Object value.
      • toString

        public java.lang.String toString()
        Get the String value.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The String representation of the internal value.
      • toExternal

        public java.lang.String toExternal()
        Returns an external representation of this value
      • fromExternal

        public Value fromExternal(java.lang.String external)
                           throws java.lang.IllegalArgumentException
        Set to value from the external respresentation
        Throws:
        java.lang.IllegalArgumentException

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.