Package uk.ac.starlink.ttools.convert
Interface ValueConverter
-
- All Known Implementing Classes:
Iso8601Converter
,Iso8601ToDecimalYear
,Iso8601ToJulian
,SexagesimalToDegrees
public interface ValueConverter
Defines a conversion from one data type to another.Instances of this class should be thread-safe.
- Since:
- 24 Feb 2006
- Author:
- Mark Taylor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Object
convert(java.lang.Object in)
Performs a conversion from the input type to the output type.uk.ac.starlink.table.ValueInfo
getInputInfo()
Returns metadata describing the values on the input end of the conversion.uk.ac.starlink.table.ValueInfo
getOutputInfo()
Returns metadata describing the values on the output end of the conversion.java.lang.Object
unconvert(java.lang.Object out)
Performs a reverse conversion, from the output type to the input type.
-
-
-
Method Detail
-
getInputInfo
uk.ac.starlink.table.ValueInfo getInputInfo()
Returns metadata describing the values on the input end of the conversion.- Returns:
- input info
-
getOutputInfo
uk.ac.starlink.table.ValueInfo getOutputInfo()
Returns metadata describing the values on the output end of the conversion.- Returns:
- output info
-
convert
java.lang.Object convert(java.lang.Object in)
Performs a conversion from the input type to the output type. In general if the conversion cannot be done, a null value should be returned rather than throwing an unchecked exception.- Parameters:
in
- object of input type- Returns:
- corresponding object of output type
-
unconvert
java.lang.Object unconvert(java.lang.Object out)
Performs a reverse conversion, from the output type to the input type. In general if the conversion cannot be done, a null value should be returned rather than throwing an unchecked exception.- Parameters:
out
- object of output type- Returns:
- corresponding object of input type
-
-