jsky.catalog
Class FieldFormat

java.lang.Object
  extended by jsky.catalog.FieldFormat

public class FieldFormat
extends java.lang.Object

This utility class provides a method to scan specially formatted values from a string and return an object of the correct type.


Constructor Summary
FieldFormat()
           
 
Method Summary
static java.lang.Object getValue(FieldDesc fieldDesc, java.lang.String s)
          Return an object for the given field description by parsing the given string.
static ValueRange getValueRange(FieldDesc fieldDesc, java.lang.String s)
          Return a ValueRange object representing a range of values for the given field by parsing the given string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldFormat

public FieldFormat()
Method Detail

getValue

public static java.lang.Object getValue(FieldDesc fieldDesc,
                                        java.lang.String s)
Return an object for the given field description by parsing the given string.

Parameters:
fieldDesc - describes the field
s - the value in string format
Returns:
an object of the given class, or null if it could not be parsed

getValueRange

public static ValueRange getValueRange(FieldDesc fieldDesc,
                                       java.lang.String s)
Return a ValueRange object representing a range of values for the given field by parsing the given string.

Parameters:
fieldDesc - describes the field
s - the value range in string format, which may be encoded as two values: "min max", as one value: "value" (For numerical types, tests for equality, for Strings, the start of the string). The symbols ">", or "<" may be used in the string for numerical types, to indicate that the value should be greater than or less than the (noninclusive) given values, for example: ">0.0 <1.0". If there are two values, they should be separated by a single space and the first value should be the minimum value (inclusive, unless ">" was specified).
Returns:
a ValueRange object representing the range of values, or null if they could not be parsed