uk.ac.starlink.vo
Class ValueConverter.UnitValueConverter

java.lang.Object
  extended by uk.ac.starlink.vo.ValueConverter
      extended by uk.ac.starlink.vo.ValueConverter.UnitValueConverter
Enclosing class:
ValueConverter

public static class ValueConverter.UnitValueConverter
extends ValueConverter

ValueConverter class which scales by a given factor (represents a particular unit).


Nested Class Summary
 
Nested classes/interfaces inherited from class uk.ac.starlink.vo.ValueConverter
ValueConverter.DMSDegreesValueConverter, ValueConverter.HMSDegreesValueConverter, ValueConverter.UnitValueConverter
 
Constructor Summary
ValueConverter.UnitValueConverter(String name, double factor)
          Constructor.
 
Method Summary
 double convertValue(String sval)
          Converts a string value to a numeric for this format
 String unconvertValue(double dval)
          Converts a numeric value to a string value for this format.
 
Methods inherited from class uk.ac.starlink.vo.ValueConverter
getName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValueConverter.UnitValueConverter

public ValueConverter.UnitValueConverter(String name,
                                         double factor)
Constructor.

Parameters:
name - unit name
factor - unit conversion factor
Method Detail

convertValue

public double convertValue(String sval)
Description copied from class: ValueConverter
Converts a string value to a numeric for this format

Specified by:
convertValue in class ValueConverter
Parameters:
sval - string value
Returns:
numeric equivalent of sval

unconvertValue

public String unconvertValue(double dval)
Description copied from class: ValueConverter
Converts a numeric value to a string value for this format.

Specified by:
unconvertValue in class ValueConverter
Parameters:
dval - numeric value
Returns:
string representation of dval


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