public abstract class NumberConverter<T extends Number> extends Object implements Converter<T>
Constructor and Description |
---|
NumberConverter() |
Modifier and Type | Method and Description |
---|---|
String |
format(T value)
Converts a value of the type returned by
Converter.getValueType() to its
plain text representation. |
abstract Class<? extends T> |
getValueType()
Gets the value type.
|
T |
parse(String value)
Converts a value from its plain text representation to a Java object instance
of the type returned by
Converter.getValueType() . |
protected abstract T |
parseNumber(String value) |
public abstract Class<? extends T> getValueType()
Converter
getValueType
in interface Converter<T extends Number>
public T parse(String value) throws ConversionException
Converter
Converter.getValueType()
.parse
in interface Converter<T extends Number>
value
- The textual representation of the value.ConversionException
- If the conversion fails.protected abstract T parseNumber(String value) throws NumberFormatException
NumberFormatException
public String format(T value)
Converter
Converter.getValueType()
to its
plain text representation.Copyright © 2014–2022 European Space Agency (ESA). All rights reserved.