|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mycore.datamodel.metadata.MCRMetaDefault
org.mycore.datamodel.metadata.MCRMetaNumber
public final class MCRMetaNumber
This class implements all method for handling with the MCRMetaNumber part of a metadata object. The MCRMetaNumber class present a number value in decimal format and optional a type and a measurement. The number can has the format like xxxx.xxx or xxxx,xxx. There was stored three numbers after the dot and nine befor them. Also you can store an integer.
<tag class="MCRMetaNumber" heritable="...">
<subtag type="..." xml:lang="..." measurement="...">
xxxx.xxx or xxx
</subtag>
</tag>
| Field Summary | |
|---|---|
static int |
MAX_DIMENSION_LENGTH
The length of the attributes * |
static int |
MAX_MEASUREMENT_LENGTH
|
| Fields inherited from class org.mycore.datamodel.metadata.MCRMetaDefault |
|---|
datapart, DEFAULT_DATAPART, DEFAULT_INHERITED, DEFAULT_LANG_LENGTH, DEFAULT_LANGUAGE, DEFAULT_STRING_LENGTH, DEFAULT_TYPE_LENGTH, inherited, lang, LOGGER, NL, subtag, type |
| Constructor Summary | |
|---|---|
MCRMetaNumber()
This is the constructor. |
|
MCRMetaNumber(String set_datapart,
String set_subtag,
String default_lang,
int set_inherted,
String set_dimension,
String set_measurement,
double set_number)
This is the constructor. |
|
MCRMetaNumber(String set_datapart,
String set_subtag,
String default_lang,
int set_inherted,
String set_dimension,
String set_measurement,
String set_number)
This is the constructor. |
|
| Method Summary | |
|---|---|
Object |
clone()
This method make a clone of this class. |
Element |
createXML()
This method create a XML stream for all data in this class, defined by the MyCoRe XML MCRNumber definition for the given subtag. |
void |
debug()
This method put debug data to the logger (for the debug mode). |
String |
getDimension()
This method get the dimension element. |
String |
getMeasurement()
This method get the measurement element. |
double |
getNumber()
This method get the number element. |
String |
getNumberToString()
This method get the number element as String. |
boolean |
isValid()
This method check the validation of the content of this class. |
void |
setDimension(String set_dimension)
This method set the dimension, if it is null, an empty string was set to the dimension element. |
void |
setFromDOM(Element element)
This method read the XML input stream part from a DOM part for the metadata of the document. |
void |
setMeasurement(String set_measurement)
This method set the measurement, if it is null, an empty string was set to the measurement element. |
void |
setNumber(double set_number)
This method set the number. |
void |
setNumber(String set_number)
This method set the number, if it is null or not a number, a MCRException was thowed. |
| Methods inherited from class org.mycore.datamodel.metadata.MCRMetaDefault |
|---|
debugDefault, decrementInherited, getDataPart, getInherited, getInheritedToString, getLang, getSubTag, getType, incrementInherited, setDataPart, setInherited, setLang, setSubTag, setType |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_DIMENSION_LENGTH
public static final int MAX_MEASUREMENT_LENGTH
| Constructor Detail |
|---|
public MCRMetaNumber()
public MCRMetaNumber(String set_datapart,
String set_subtag,
String default_lang,
int set_inherted,
String set_dimension,
String set_measurement,
String set_number)
throws MCRException
set_datapart - the global part of the elements like 'metadata'
or 'service'set_subtag - the name of the subtagdefault_lang - the default languageset_inherted - a value >= 0set_dimension - the optional dimension stringset_measurement - the optional measurement stringset_number - the number string
MCRException - if the set_subtag value is null or empty or if
the number string is not in a number format
public MCRMetaNumber(String set_datapart,
String set_subtag,
String default_lang,
int set_inherted,
String set_dimension,
String set_measurement,
double set_number)
throws MCRException
set_datapart - the global part of the elements like 'metadata'
or 'service'set_subtag - the name of the subtagdefault_lang - the default languageset_inherted - a value >= 0set_dimension - the optional dimension stringset_measurement - the optional measurement stringset_number - the number value
MCRException - if the set_subtag value is null or empty| Method Detail |
|---|
public final void setDimension(String set_dimension)
set_dimension - the dimension stringpublic final void setMeasurement(String set_measurement)
set_measurement - the measurement stringpublic final void setNumber(String set_number)
set_number - the number string
MCRException - if the number string is not in a number formatpublic final void setNumber(double set_number)
set_number - the number valuepublic final String getDimension()
public final String getMeasurement()
public final double getNumber()
public final String getNumberToString()
public final void setFromDOM(Element element)
setFromDOM in interface MCRMetaInterfacesetFromDOM in class MCRMetaDefaultelement - a relevant JDOM element for the metadata
public final Element createXML()
throws MCRException
createXML in interface MCRMetaInterfacecreateXML in class MCRMetaDefaultMCRException - if the content of this class is not validpublic final boolean isValid()
isValid in interface MCRMetaInterfaceisValid in class MCRMetaDefaultpublic final Object clone()
clone in interface MCRMetaInterfaceclone in class MCRMetaDefaultpublic final void debug()
debug in interface MCRMetaInterfacedebug in class MCRMetaDefault
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||