com.flexive.shared.value
Class FxBoolean

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

public class FxBoolean
extends FxValue<java.lang.Boolean,FxBoolean>
implements java.io.Serializable

A multilingual Boolean, internally represented as Boolean; EMPTY is false

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.Boolean EMPTY
           
 
Fields inherited from class com.flexive.shared.value.FxValue
DEFAULT_MULTILANGUAGE, defaultLanguage, emptyTranslations, multiLanguage, singleValue, translations, VALUE_NODATA
 
Constructor Summary
FxBoolean(java.lang.Boolean value)
          Constructor
FxBoolean(boolean multiLanguage, java.lang.Boolean value)
          Constructor
FxBoolean(boolean multiLanguage, long defaultLanguage, java.lang.Boolean value)
          Constructor
FxBoolean(boolean multiLanguage, long defaultLanguage, java.util.Map<java.lang.Long,java.lang.Boolean> translations)
          Constructor
FxBoolean(boolean multiLanguage, java.util.Map<java.lang.Long,java.lang.Boolean> translations)
          Constructor
FxBoolean(FxValue<java.lang.Boolean,FxBoolean> clone)
          Constructor
FxBoolean(long defaultLanguage)
          Constructor
FxBoolean(long defaultLanguage, java.lang.Boolean value)
          Constructor
FxBoolean(long defaultLanguage, java.util.Map<java.lang.Long,java.lang.Boolean> translations)
          Constructor
FxBoolean(java.util.Map<java.lang.Long,java.lang.Boolean[]> translations, int pos)
          Constructor - create value from an array of translations
FxBoolean(java.util.Map<java.lang.Long,java.lang.Boolean> translations)
          Constructor
 
Method Summary
 FxBoolean copy()
          Creates a copy of the given object (useful if the actual type is unknown).
 java.lang.Boolean fromString(java.lang.String value)
          Evaluates the given string value to an object of type T.
 java.lang.Boolean getEmptyValue()
          Returns an empty value object for this FxValue type.
 java.lang.String getStringValue(java.lang.Boolean value)
          Converts the given instance of T to a string that can be parsed again by FxValue.fromString(String).
 java.lang.Class<java.lang.Boolean> 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, clearValueData, compareTo, copyValue, equals, fromPortableString, getBestTranslation, getBestTranslation, getBestTranslation, getBestTranslation, getDefaultLanguage, getDefaultTranslation, getErrorValue, getIsEmpty, getMaxInputLength, getPortableStringValue, getSelectedLanguage, getSqlValue, getTranslatedLanguages, getTranslation, getTranslation, getValueData, getValueDataRaw, getXPath, getXPathName, hasDefaultLanguage, hashCode, hasValueData, isAcceptsEmptyDefaultTranslations, isDefaultLanguage, isEmpty, isMultiLanguage, isReadOnly, isTranslationEmpty, isTranslationEmpty, isValid, isValid, isValid, removeLanguage, setChangeListener, setDefaultLanguage, setDefaultLanguage, setDefaultTranslation, setEmpty, setEmpty, setMaxInputLength, setReadOnly, setSelectedLanguage, setTranslation, setTranslation, setValue, setValueData, setXPath, 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.Boolean EMPTY
Constructor Detail

FxBoolean

public FxBoolean(long defaultLanguage)
Constructor

Parameters:
defaultLanguage - the default language

FxBoolean

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

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

FxBoolean

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

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

FxBoolean

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

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

FxBoolean

public FxBoolean(java.util.Map<java.lang.Long,java.lang.Boolean> translations)
Constructor

Parameters:
translations - HashMap containing language->translation mapping

FxBoolean

public FxBoolean(java.util.Map<java.lang.Long,java.lang.Boolean[]> 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

FxBoolean

public FxBoolean(boolean multiLanguage,
                 long defaultLanguage,
                 java.lang.Boolean value)
Constructor

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

FxBoolean

public FxBoolean(long defaultLanguage,
                 java.lang.Boolean value)
Constructor

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

FxBoolean

public FxBoolean(boolean multiLanguage,
                 java.lang.Boolean value)
Constructor

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

FxBoolean

public FxBoolean(java.lang.Boolean value)
Constructor

Parameters:
value - single initializing value

FxBoolean

public FxBoolean(FxValue<java.lang.Boolean,FxBoolean> clone)
Constructor

Parameters:
clone - original FxValue to be cloned
Method Detail

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.Boolean,FxBoolean>
Returns:
true if T is immutable (e.g. java.lang.String)

fromString

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

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

getStringValue

public java.lang.String getStringValue(java.lang.Boolean value)
Converts the given instance of T to a string that can be parsed again by FxValue.fromString(String).

Overrides:
getStringValue in class FxValue<java.lang.Boolean,FxBoolean>
Parameters:
value - the value to be converted
Returns:
a string representation of the given value that can be parsed again using FxValue.fromString(String).

copy

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

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

getValueClass

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

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

getEmptyValue

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

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