|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdods.clients.importwizard.TMAP.convert.Convert
dods.clients.importwizard.TMAP.convert.ConvertLongitude
public class ConvertLongitude
A class for conversions between double and String along a Longitude axis. The axis will have a range of acceptable values. This package is designed to be hooked up with TextInputFields for region specification on database servers.
Field Summary | |
---|---|
static int |
E_W
|
static int |
M180_180
|
static int |
SPACE_E_W
|
static int |
SPACE_EAST_WEST
|
static int |
ZERO_360
|
Fields inherited from class dods.clients.importwizard.TMAP.convert.Convert |
---|
HI, LO, outputStyle, range, units |
Constructor Summary | |
---|---|
ConvertLongitude()
Creates a Convert object. |
|
ConvertLongitude(int style)
Creates a ConvertLongitude object with a predefined outputStyle. |
Method Summary | |
---|---|
double |
getNearestValue(double val)
Returns the nearest value within the range. |
double[] |
intersectRange(double val_lo,
double val_hi)
Returns the intersection of the incoming range within the internal range. |
protected double |
rangeTest(double val)
Tests a value against the range. |
void |
setOutputStyle(int style)
Sets the output style for the toString() method. |
void |
setRange(double lo,
double hi)
Sets the valid range for the ConvertLongitude object. |
double |
toDouble(String s)
Converts a Longitude string to a double value. |
String |
toString(double val)
Converts a double value to a Longitude String. |
Methods inherited from class dods.clients.importwizard.TMAP.convert.Convert |
---|
getNearestValue, getRange, getRange, getUnits, setUnits, toString, unitTest |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int M180_180
public static final int ZERO_360
public static final int E_W
public static final int SPACE_E_W
public static final int SPACE_EAST_WEST
Constructor Detail |
---|
public ConvertLongitude()
public ConvertLongitude(int style)
style
- one of the supported output styles.Method Detail |
---|
public void setOutputStyle(int style)
public void setRange(double lo, double hi) throws IllegalArgumentException
setRange
in class Convert
lo
- the lowest acceptable value.hi
- the highest acceptable value.
IllegalArgumentException
public double toDouble(String s) throws IllegalArgumentException
toDouble
in class Convert
s
- String representing the Longitude.
IllegalArgumentException
- if s cannot be interpreted.public String toString(double val)
toString
in class Convert
val
- double value.
public double getNearestValue(double val)
getNearestValue
in class Convert
lon
- The value of the Longitude.
public double[] intersectRange(double val_lo, double val_hi) throws IllegalArgumentException
intersectRange
in class Convert
val_lo
- The lo value of the range to be tested.val_hi
- The hi value of the range to be tested.
IllegalArgumentException
- range is outside
the internally defined range.protected double rangeTest(double val) throws IllegalArgumentException
rangeTest
in class Convert
lon
- The value of the Longitude.
IllegalArgumentException
- if val is
outisde the specified range.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |