org.openehr.rm.datatypes.text
Class DvText

java.lang.Object
  extended by org.openehr.rm.RMObject
      extended by org.openehr.rm.datatypes.basic.DataValue
          extended by org.openehr.rm.datatypes.text.DvText
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DvCodedText

public class DvText
extends DataValue

The Text class represents any kind of atomic text item, coded or uncoded. Instances of this class are immutable.

Version:
1.0
Author:
Rong Chen
See Also:
Serialized Form

Constructor Summary
protected DvText()
           
  DvText(java.lang.String value)
          Constructs a DvText by required value
  DvText(java.lang.String value, CodePhrase language, CodePhrase charset, TerminologyService terminologyService)
          Constructs a DvText by string value, language and charset
  DvText(java.lang.String value, java.util.List<TermMapping> mappings, java.lang.String formatting, DvURI hyperlink, CodePhrase language, CodePhrase charset, TerminologyService terminologyService)
          Constructs a Text from the given components.
 
Method Summary
 boolean equals(java.lang.Object o)
          Returns true if both has the same values for string value, language and charset, all optional attributes are not included in comparision
 CodePhrase getCharset()
          Name of character set in which this value is encoded.
 java.lang.String getFormatting()
          Returns formatting of this Text
 DvURI getHyperlink()
          Returns hyperlink of this Text
 CodePhrase getLanguage()
          Optional indicator of the localised language in which the value is written.
 java.util.List<TermMapping> getMappings()
          Return mappings of this Text
 java.lang.String getValue()
          Returns value of this Text
 int hashCode()
          Returns a hash code of this Text
protected  void setCharset(CodePhrase charset)
           
protected  void setFormatting(java.lang.String formatting)
           
protected  void setHyperlink(DvURI hyperlink)
           
protected  void setLanguage(CodePhrase language)
           
protected  void setMappings(java.util.List<TermMapping> mappings)
           
protected  void setValue(java.lang.String value)
           
 java.lang.String toString()
          string form displayable for humans
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DvText

public DvText(java.lang.String value,
              java.util.List<TermMapping> mappings,
              java.lang.String formatting,
              DvURI hyperlink,
              CodePhrase language,
              CodePhrase charset,
              TerminologyService terminologyService)
Constructs a Text from the given components.

Parameters:
value - not null or empty or contains
mappings - null if unspecified
formatting - null if unspecified
hyperlink - null if unspecifed
language - not null and valid language code
charset - not null and valid charset code
terminologyService - not null
Throws:
java.lang.IllegalArgumentException - if any of the components is invalid

DvText

public DvText(java.lang.String value,
              CodePhrase language,
              CodePhrase charset,
              TerminologyService terminologyService)
Constructs a DvText by string value, language and charset

Parameters:
value -
language -
charset -
terminologyService -
Throws:
java.lang.IllegalArgumentException - if value, language or charset are empty or invalid

DvText

public DvText(java.lang.String value)
Constructs a DvText by required value

Parameters:
value -

DvText

protected DvText()
Method Detail

toString

public java.lang.String toString()
string form displayable for humans

Overrides:
toString in class DataValue
Returns:
String

getValue

public java.lang.String getValue()
Returns value of this Text

Returns:
string value

getMappings

public java.util.List<TermMapping> getMappings()
Return mappings of this Text

Returns:
null if unspecified

getFormatting

public java.lang.String getFormatting()
Returns formatting of this Text

Returns:
null if unspecified

getHyperlink

public DvURI getHyperlink()
Returns hyperlink of this Text

Returns:
null if unspecified

getLanguage

public CodePhrase getLanguage()
Optional indicator of the localised language in which the value is written. Coded from openEHR Code Set languages. Only used when either the text object is in a different language from the enclosing ENTRY, or else the text object is being used outside of an ENTRY or other enclosing structure which indicates the language.

Returns:
language or null if not specified

getCharset

public CodePhrase getCharset()
Name of character set in which this value is encoded. Coded from openEHR Code Set character sets.

Returns:
character set or null if not specified

equals

public boolean equals(java.lang.Object o)
Returns true if both has the same values for string value, language and charset, all optional attributes are not included in comparision

Overrides:
equals in class java.lang.Object
Parameters:
o -
Returns:
true if equals

hashCode

public int hashCode()
Returns a hash code of this Text

Overrides:
hashCode in class java.lang.Object
Returns:
hashcode

setValue

protected void setValue(java.lang.String value)

setMappings

protected void setMappings(java.util.List<TermMapping> mappings)

setFormatting

protected void setFormatting(java.lang.String formatting)

setHyperlink

protected void setHyperlink(DvURI hyperlink)

setLanguage

protected void setLanguage(CodePhrase language)

setCharset

protected void setCharset(CodePhrase charset)


Copyright © 2004-2005 Acode HB. All Rights Reserved.