public class DoubleStringConverter extends AbstractNumberStringConverter<Double>
| Constructor and Description |
|---|
DoubleStringConverter(ValueModel<Double> pSubject)
Create a new Double-to-String converter where null is a valid value.
|
DoubleStringConverter(ValueModel<Double> pSubject,
boolean pNullIsValid)
Create a new Double-to-String converter.
|
DoubleStringConverter(ValueModel<Double> pSubject,
NumberFormat pFormat)
Create a new Double-to-String converter where null is a valid value.
|
DoubleStringConverter(ValueModel<Double> pSubject,
NumberFormat pFormat,
boolean pNullIsValid)
Create a new Double-to-String converter.
|
| Modifier and Type | Method and Description |
|---|---|
protected Double |
convertToNumber(String pOwnValue)
convert the own string value to the number.
|
protected String |
convertToString(Number pSubjectValue)
Converts from a Number to the String by calling toString.
|
convertOwnToSubjectValue, convertSubjectToOwnValue, getNullIsValid, setNullIsValid, setNullSubstitutedispose, getPropagateFailedConversions, getSubject, getSubjectValue, getSyncKey, getSyncMessage, getSyncState, getValue, getValue, isEditable, setPropagateFailedConversions, setSyncKey, setSyncMessage, setValue, stateChangedaddChangeListener, booleanValue, checkDisposed, doubleValue, fireStateChanged, floatValue, getDependents, getName, intValue, isDisposed, isInSetValue, isSetForced, longValue, onChangeSend, removeChangeListener, retractInterestsFor, setInSetValue, setName, setObjectValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueForced, signalExternalUpdate, stringValueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSyncKey, getSyncMessage, getSyncState, setSyncKey, setSyncMessageaddChangeListener, booleanValue, dispose, doubleValue, floatValue, getDependents, getName, getValue, intValue, isDisposed, isEditable, isSetForced, longValue, onChangeSend, removeChangeListener, retractInterestsFor, setName, setObjectValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueForced, stringValuepublic DoubleStringConverter(ValueModel<Double> pSubject)
pSubject - the ValueModel holding the original valuepublic DoubleStringConverter(ValueModel<Double> pSubject, boolean pNullIsValid)
pSubject - the ValueModel holding the original valuepNullIsValid - marker if we should use null as an
alternative value if the conversion failspublic DoubleStringConverter(ValueModel<Double> pSubject, NumberFormat pFormat)
pSubject - the ValueModel holding the original valuepFormat - the number formatter, may be nullpublic DoubleStringConverter(ValueModel<Double> pSubject, NumberFormat pFormat, boolean pNullIsValid)
pSubject - the ValueModel holding the original valuepFormat - the number formatter, may be nullpNullIsValid - marker if we should use null as an
alternative value if the conversion failsprotected String convertToString(Number pSubjectValue)
convertToString in class AbstractNumberStringConverter<Double>pSubjectValue - the value in the source type (Number), never nullprotected Double convertToNumber(String pOwnValue) throws NumberFormatException
return new Integer( ownValue);
.
If the conversion is not possible, you can throw a NumberFormatException
which will be converted into a ConversionException with the correct
substitute values.convertToNumber in class AbstractNumberStringConverter<Double>pOwnValue - the value as a stringNumberFormatException - if the string value is not parsable into a numberCopyright © 2017 Jürgen Zeller (privat). All rights reserved.