public interface MDecimalString extends MString
This defines a string
field containing a decimal number
representation.
A decimal number has an optional decimal point and is parsed, compared and output according to the scale (the number of digits to the right of the decimal point) of the field.
Represented internally as a BigDecimal
.
It is possible to parse the value of an item of this type from any object
whose toString
method returns a value that can be
successfully supplied to the BigDecimal(String)
constructor. In addition, if the field
permits
it, an empty field (zero length string}
could also be parsed.
The easiest way to create a decimal metadata field is using
MetadataFactory.decimal(String)
or one of its variants that allow an
initial value to be supplied. For example:
MetadataFactory factory = Diffusion.metadata();
MDecimalString decimal = factory.decimal("A",2.00);
Alternatively for more complex requirements a MDecimalString.Builder
may be used.Modifier and Type | Interface and Description |
---|---|
static interface |
MDecimalString.Builder
Decimal string field metadata builder.
|
MString.AbstractBuilder<T,B>
MField.FieldType
MNode.DataType, MNode.Multiplicity, MNode.NodeType
Modifier and Type | Method and Description |
---|---|
int |
getScale()
Returns the scale of the field.
|
allowsEmpty, getDefaultValue
getFieldType
getDataType, getFullName, getMultiplicity, getName, getNodeType, getParent
Copyright © 2016 Push Technology Ltd. All Rights Reserved.