com.flexive.shared.value
Class FxDouble

java.lang.Object
  extended by com.flexive.shared.value.FxValue<java.lang.Double,FxDouble>
      extended by com.flexive.shared.value.FxDouble
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<FxValue>

public class FxDouble
extends FxValue<java.lang.Double,FxDouble>
implements java.io.Serializable

A multilingual Double, internally represented as Double

Author:
Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
Serialized Form

Field Summary
static java.lang.Double EMPTY
           
 
Fields inherited from class com.flexive.shared.value.FxValue
DEFAULT_MULTILANGUAGE, defaultLanguage, emptyTranslations, multiLanguage, singleValue, translations
 
Constructor Summary
FxDouble(boolean multiLanguage, java.lang.Double value)
          Constructor
FxDouble(boolean multiLanguage, long defaultLanguage, java.lang.Double value)
          Constructor
FxDouble(boolean multiLanguage, long defaultLanguage, java.util.Map<java.lang.Long,java.lang.Double> translations)
          Constructor
FxDouble(boolean multiLanguage, java.util.Map<java.lang.Long,java.lang.Double> translations)
          Constructor
FxDouble(java.lang.Double value)
          Constructor
FxDouble(FxValue<java.lang.Double,FxDouble> clone)
          Constructor
FxDouble(long defaultLanguage, boolean multiLanguage)
          Constructor
FxDouble(long defaultLanguage, java.lang.Double value)
          Constructor
FxDouble(long defaultLanguage, java.util.Map<java.lang.Long,java.lang.Double> translations)
          Constructor
FxDouble(java.util.Map<java.lang.Long,java.lang.Double[]> translations, int pos)
          Constructor - create value from an array of translations
FxDouble(java.util.Map<java.lang.Long,java.lang.Double> translations)
          Constructor
 
Method Summary
 int compareTo(FxValue o)
          A generic comparable implementation based on the value's string representation.
 FxDouble copy()
          Creates a copy of the given object (useful if the actual type is unknown).
 java.lang.Double fromString(java.lang.String value)
          Evaluates the given string value to an object of type T.
 java.lang.Double getEmptyValue()
          Returns an empty value object for this FxValue type.
 java.lang.Class<java.lang.Double> getValueClass()
          Return the class instance of the value type.
 boolean isImmutableValueType()
          Return true if T is immutable (e.g.
 
Methods inherited from class com.flexive.shared.value.FxValue
clearDefaultLanguage, equals, getBestTranslation, getBestTranslation, getBestTranslation, getBestTranslation, getDefaultLanguage, getDefaultTranslation, getErrorValue, getIsEmpty, getMaxInputLength, getSelectedLanguage, getSqlValue, getStringValue, getTranslatedLanguages, getTranslation, getTranslation, getXPath, getXPathName, hasDefaultLanguage, hashCode, isAcceptsEmptyDefaultTranslations, isDefaultLanguage, isEmpty, isMultiLanguage, isReadOnly, isTranslationEmpty, isTranslationEmpty, isValid, removeLanguage, setDefaultLanguage, setDefaultLanguage, setDefaultTranslation, setEmpty, setEmpty, setMaxInputLength, setReadOnly, setSelectedLanguage, setTranslation, setTranslation, setValue, setXPath, toString, translationExists
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final java.lang.Double EMPTY
Constructor Detail

FxDouble

public FxDouble(long defaultLanguage,
                boolean multiLanguage)
Constructor

Parameters:
multiLanguage - multilanguage value?
defaultLanguage - the default language

FxDouble

public FxDouble(boolean multiLanguage,
                long defaultLanguage,
                java.util.Map<java.lang.Long,java.lang.Double> translations)
Constructor

Parameters:
multiLanguage - multilanguage value?
defaultLanguage - the default language
translations - HashMap containing language->translation mapping

FxDouble

public FxDouble(long defaultLanguage,
                java.util.Map<java.lang.Long,java.lang.Double> translations)
Constructor

Parameters:
defaultLanguage - the default language
translations - HashMap containing language->translation mapping

FxDouble

public FxDouble(boolean multiLanguage,
                java.util.Map<java.lang.Long,java.lang.Double> translations)
Constructor

Parameters:
multiLanguage - multilanguage value?
translations - HashMap containing language->translation mapping

FxDouble

public FxDouble(java.util.Map<java.lang.Long,java.lang.Double> translations)
Constructor

Parameters:
translations - HashMap containing language->translation mapping

FxDouble

public FxDouble(java.util.Map<java.lang.Long,java.lang.Double[]> translations,
                int pos)
Constructor - create value from an array of translations

Parameters:
translations - HashMap containing language->translation mapping
pos - position (index) in the array to use

FxDouble

public FxDouble(boolean multiLanguage,
                long defaultLanguage,
                java.lang.Double value)
Constructor

Parameters:
multiLanguage - multilanguage value?
defaultLanguage - the default language
value - single initializing value

FxDouble

public FxDouble(long defaultLanguage,
                java.lang.Double value)
Constructor

Parameters:
defaultLanguage - the default language
value - single initializing value

FxDouble

public FxDouble(boolean multiLanguage,
                java.lang.Double value)
Constructor

Parameters:
multiLanguage - multilanguage value?
value - single initializing value

FxDouble

public FxDouble(java.lang.Double value)
Constructor

Parameters:
value - single initializing value

FxDouble

public FxDouble(FxValue<java.lang.Double,FxDouble> clone)
Constructor

Parameters:
clone - original FxValue to be cloned
Method Detail

fromString

public java.lang.Double fromString(java.lang.String value)
Evaluates the given string value to an object of type T.

Specified by:
fromString in class FxValue<java.lang.Double,FxDouble>
Parameters:
value - string value to be evaluated
Returns:
the value interpreted as T

copy

public FxDouble copy()
Creates a copy of the given object (useful if the actual type is unknown).

Specified by:
copy in class FxValue<java.lang.Double,FxDouble>
Returns:
a copy of the given object (useful if the actual type is unknown).

isImmutableValueType

public boolean isImmutableValueType()
Return true if T is immutable (e.g. java.lang.String). This prevents cloning of the translations in copy constructors.

Overrides:
isImmutableValueType in class FxValue<java.lang.Double,FxDouble>
Returns:
true if T is immutable (e.g. java.lang.String)

getValueClass

public java.lang.Class<java.lang.Double> getValueClass()
Return the class instance of the value type.

Specified by:
getValueClass in class FxValue<java.lang.Double,FxDouble>
Returns:
the class instance of the value type.

getEmptyValue

public java.lang.Double getEmptyValue()
Returns an empty value object for this FxValue type.

Specified by:
getEmptyValue in class FxValue<java.lang.Double,FxDouble>
Returns:
an empty value object for this FxValue type.

compareTo

public int compareTo(FxValue o)
Description copied from class: FxValue
A generic comparable implementation based on the value's string representation.

Specified by:
compareTo in interface java.lang.Comparable<FxValue>
Overrides:
compareTo in class FxValue<java.lang.Double,FxDouble>
Parameters:
o - the other object
Returns:
see Comparable.compareTo(T).