eu.etaxonomy.cdm.model.description
Class StateData

java.lang.Object
  extended by eu.etaxonomy.cdm.model.common.CdmBase
      extended by eu.etaxonomy.cdm.model.common.VersionableEntity
          extended by eu.etaxonomy.cdm.model.description.StateData
All Implemented Interfaces:
ICdmBase, IMultiLanguageTextHolder, IVersionableEntity, IModifiable, Serializable, Cloneable

@Entity
public class StateData
extends VersionableEntity
implements IModifiable, IMultiLanguageTextHolder, Cloneable

This class represents the assignment of values (state terms) to features corresponding to categorical data. A state data instance constitutes an atomized part of an information piece (categorical data) so that several state data instances may belong to one categorical data instance.

This class corresponds to CharacterStateDataType according to the SDD schema.

Version:
1.0
Author:
m.doering
See Also:
Serialized Form

Field Summary
 
Fields inherited from class eu.etaxonomy.cdm.model.common.CdmBase
uuid
 
Constructor Summary
StateData()
          Class constructor: creates a new empty state data instance.
 
Method Summary
 void addModifier(Modifier modifier)
          Adds a modifier to the set of modifiers used to qualify the validity of this state data.
 LanguageString addModifyingText(LanguageString text)
          Deprecated. should follow the put semantic of maps, this method will be removed in v4.0 Use the putModifyingText method instead
 LanguageString addModifyingText(String text, Language language)
          Deprecated. should follow the put semantic of maps, this method will be removed in v4.0 Use the putModifyingText method instead
 Object clone()
          Clones this state data.
 Set<Modifier> getModifiers()
          Returns the set of modifiers used to qualify the validity of this state data.
 Map<Language,LanguageString> getModifyingText()
          Returns the multilanguage text used to qualify the validity of this state data.
 State getState()
          Returns the state term used in this state data.
static StateData NewInstance()
          Creates a new empty state data instance.
static StateData NewInstance(State state)
          Creates a new empty state data instance.
 LanguageString putModifyingText(LanguageString text)
          Adds a translated text in a particular language to the multilanguage text used to qualify the validity of this state data.
 LanguageString putModifyingText(Language language, String text)
          Creates a language string based on the given text string and the given language and adds it to the multilanguage text used to qualify the validity of this state data.
 void removeModifier(Modifier modifier)
          Removes one element from the set of modifiers used to qualify the validity of this state data.
 LanguageString removeModifyingText(Language lang)
          Removes from the multilanguage text used to qualify the validity of this state data the one language string with the given language.
 void setState(State state)
           
 
Methods inherited from class eu.etaxonomy.cdm.model.common.VersionableEntity
equals, getUpdated, getUpdatedBy, setUpdated, setUpdatedBy
 
Methods inherited from class eu.etaxonomy.cdm.model.common.CdmBase
addPropertyChangeListener, addPropertyChangeListener, clone, deproxy, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getCreated, getCreatedBy, getId, getUuid, hashCode, hasListeners, instanceToString, invokeSetMethod, invokeSetMethodWithNull, isInstanceOf, removePropertyChangeListener, removePropertyChangeListener, setCreated, setCreatedBy, setId, setUuid, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface eu.etaxonomy.cdm.model.common.IVersionableEntity
getUpdated, getUpdatedBy, setUpdated, setUpdatedBy
 
Methods inherited from interface eu.etaxonomy.cdm.model.common.ICdmBase
getCreated, getCreatedBy, getId, getUuid, setCreated, setCreatedBy, setId, setUuid
 

Constructor Detail

StateData

public StateData()
Class constructor: creates a new empty state data instance.

Method Detail

NewInstance

public static StateData NewInstance()
Creates a new empty state data instance.


NewInstance

public static StateData NewInstance(State state)
Creates a new empty state data instance. NOTE: State is a sub class of DefinedTermBase. If the state passed as parameter has been created newly it has to be persisted before it is possible to save the StateData.


getState

public State getState()
Returns the state term used in this state data.


setState

public void setState(State state)
See Also:
getState()

getModifiers

public Set<Modifier> getModifiers()
Returns the set of modifiers used to qualify the validity of this state data. This is only metainformation.

Specified by:
getModifiers in interface IModifiable

addModifier

public void addModifier(Modifier modifier)
Adds a modifier to the set of modifiers used to qualify the validity of this state data.

Specified by:
addModifier in interface IModifiable
Parameters:
modifier - the modifier to be added to this state data
See Also:
getModifiers()

removeModifier

public void removeModifier(Modifier modifier)
Removes one element from the set of modifiers used to qualify the validity of this state data.

Specified by:
removeModifier in interface IModifiable
Parameters:
modifier - the modifier which should be removed
See Also:
getModifiers(), addModifier(Modifier)

getModifyingText

public Map<Language,LanguageString> getModifyingText()
Returns the multilanguage text used to qualify the validity of this state data. The different language strings contained in the multilanguage text should all have the same meaning.
A multilanguage text does not belong to a controlled term vocabulary as a modifier does.

NOTE: the actual content of this state data is NOT stored in the modifying text. This is only metainformation (like "Some experts express doubt about this assertion").


addModifyingText

@Deprecated
public LanguageString addModifyingText(String text,
                                                  Language language)
Deprecated. should follow the put semantic of maps, this method will be removed in v4.0 Use the putModifyingText method instead

Creates a language string based on the given text string and the given language and adds it to the multilanguage text used to qualify the validity of this state data.

Parameters:
text - the string describing the validity in a particular language
language - the language in which the text string is formulated
See Also:
getModifyingText(), putModifyingText(LanguageString)

putModifyingText

public LanguageString putModifyingText(Language language,
                                       String text)
Creates a language string based on the given text string and the given language and adds it to the multilanguage text used to qualify the validity of this state data.

Parameters:
language - the language in which the text string is formulated
text - the string describing the validity in a particular language
See Also:
getModifyingText(), addModifyingText(LanguageString)

addModifyingText

@Deprecated
public LanguageString addModifyingText(LanguageString text)
Deprecated. should follow the put semantic of maps, this method will be removed in v4.0 Use the putModifyingText method instead

Adds a translated text in a particular language to the multilanguage text used to qualify the validity of this state data.

Parameters:
text - the language string describing the validity in a particular language
See Also:
getModifyingText(), putModifyingText(Language, String)

putModifyingText

public LanguageString putModifyingText(LanguageString text)
Adds a translated text in a particular language to the multilanguage text used to qualify the validity of this state data.

Parameters:
text - the language string describing the validity in a particular language
See Also:
getModifyingText(), putModifyingText(Language, String)

removeModifyingText

public LanguageString removeModifyingText(Language lang)
Removes from the multilanguage text used to qualify the validity of this state data the one language string with the given language.

Parameters:
lang - the language in which the language string to be removed has been formulated
See Also:
getModifyingText()

clone

public Object clone()
Clones this state data. This is a shortcut that enables to create a new instance that differs only slightly from this state data by modifying only some of the attributes.

Overrides:
clone in class VersionableEntity
See Also:
VersionableEntity.clone(), Object.clone()


Copyright © 2007-2013 EDIT. All Rights Reserved.