uk.ac.starlink.ttools.convert
Class SexagesimalToDegrees

java.lang.Object
  extended by uk.ac.starlink.ttools.convert.SexagesimalToDegrees
All Implemented Interfaces:
ValueConverter

public class SexagesimalToDegrees
extends Object
implements ValueConverter

Converts between Strings in sexagesimal format and numeric values in degrees.

Since:
24 Feb 2006
Author:
Mark Taylor

Constructor Summary
SexagesimalToDegrees(ValueInfo sexInfo, boolean hours)
           
 
Method Summary
 Object convert(Object in)
          Performs a conversion from the input type to the output type.
 ValueInfo getInputInfo()
          Returns metadata describing the values on the input end of the conversion.
 ValueInfo getOutputInfo()
          Returns metadata describing the values on the output end of the conversion.
 String toString()
           
 Object unconvert(Object out)
          Performs a reverse conversion, from the output type to the input type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SexagesimalToDegrees

public SexagesimalToDegrees(ValueInfo sexInfo,
                            boolean hours)
Parameters:
sexInfo - info for data in sexagesimal format
hours - true for H:M:S, false for D:M:S
Method Detail

getInputInfo

public ValueInfo getInputInfo()
Description copied from interface: ValueConverter
Returns metadata describing the values on the input end of the conversion.

Specified by:
getInputInfo in interface ValueConverter
Returns:
input info

getOutputInfo

public ValueInfo getOutputInfo()
Description copied from interface: ValueConverter
Returns metadata describing the values on the output end of the conversion.

Specified by:
getOutputInfo in interface ValueConverter
Returns:
output info

convert

public Object convert(Object in)
Description copied from interface: ValueConverter
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.

Specified by:
convert in interface ValueConverter
Parameters:
in - object of input type
Returns:
corresponding object of output type

unconvert

public Object unconvert(Object out)
Description copied from interface: ValueConverter
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.

Specified by:
unconvert in interface ValueConverter
Parameters:
out - object of output type
Returns:
corresponding object of input type

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.