public class QualifiedValue<T> extends Object implements CommonAttributes, HasDescription, Serializable
"common attributes".| Constructor and Description |
|---|
QualifiedValue() |
QualifiedValue(T value) |
| Modifier and Type | Method and Description |
|---|---|
static <DESTINATION> |
checkConversion(QualifiedValue<?> value,
Class<DESTINATION> toClass)
Checks that the conversion can be done but leave the object untouched.
|
<DESTINATION> |
convertTo(Class<DESTINATION> clazz) |
QualifiedValue<Double> |
convertToDouble()
Converts this value to double.
|
Description |
getDescription() |
T |
getValue() |
String |
getXMCDATag()
Return the XMCDA tag for this value.
|
Type |
getXMCDAType()
Return the XMCDA
Type for this value. |
String |
id() |
boolean |
isNA()
Return
true if the value is NA |
boolean |
isNumeric()
Return
true if the value is of type integer, float, double or Rational |
String |
mcdaConcept() |
String |
name() |
void |
setDescription(Description description) |
void |
setId(String id) |
void |
setMcdaConcept(String mcdaConcept) |
void |
setName(String name) |
void |
setValue(T value) |
public QualifiedValue()
public QualifiedValue(T value)
public T getValue()
public void setValue(T value)
public String id()
id in interface CommonAttributespublic void setId(String id)
setId in interface CommonAttributespublic String name()
name in interface CommonAttributespublic String mcdaConcept()
mcdaConcept in interface CommonAttributespublic void setName(String name)
setName in interface CommonAttributespublic void setMcdaConcept(String mcdaConcept)
setMcdaConcept in interface CommonAttributespublic void setDescription(Description description)
setDescription in interface HasDescriptionpublic Description getDescription()
getDescription in interface HasDescriptionpublic static <DESTINATION> void checkConversion(QualifiedValue<?> value, Class<DESTINATION> toClass) throws ValueConverters.ConversionException
DESTINATION - the class to which the value should be convertedvalue - the value to be convertedtoClass - the class to which the value should be convertedValueConverters.ConversionException - raised if the conversion cannot be doneconvertTo(Class)public <DESTINATION> QualifiedValue<DESTINATION> convertTo(Class<DESTINATION> clazz) throws ValueConverters.ConversionException
public QualifiedValue<Double> convertToDouble() throws ValueConverters.ConversionException
this.convertTo(Double.class).QualifiedValue<Double>ValueConverters.ConversionException - if the value could not be converted to a double. Note that this may happen even if
isNumeric() is True: converting a rational with a denominator equal to zero throw
a ConversionException.public boolean isNumeric()
true if the value is of type integer, float, double or Rationaltrue if the value belongs to a sub-type of XMCDA:numeric.public boolean isNA()
true if the value is NAtrue if the value is NA, false otherwise.public String getXMCDATag() throws IllegalStateException, NullPointerException
NullPointerException - if getValue() is null.IllegalArgumentException - if the getValue() is an instance of an invalid class for an XMCDA
value.IllegalStateExceptionpublic Type getXMCDAType() throws IllegalStateException, NullPointerException
Type for this value.NullPointerException - if getValue() is null.IllegalArgumentException - if the getValue() is an instance of an invalid class for a XMCDA
value.IllegalStateExceptionCopyright © 2013–2021 Sébastien Bigaret, Patrick Meyer. All rights reserved.