org.openstreetmap.josm.plugins.graphview.core.util
Class ValueStringParser

Object
  extended by ValueStringParser

public final class ValueStringParser
extends Object


Method Summary
static Float parseAngle(String value)
          parses an angular value as given for the "direction" key.
static Color parseColor(String value)
          parses an hexadecimal color value
static Float parseIncline(String value)
          parses an incline value as given for the "incline" key.
static Float parseMeasure(String value)
          parses a measure value given e.g.
static Float parseOsmDecimal(String value, boolean allowNegative)
           
static Float parseSpeed(String value)
          parses a speed value given e.g.
static Float parseWeight(String value)
          parses a weight value given e.g.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseOsmDecimal

public static final Float parseOsmDecimal(String value,
                                          boolean allowNegative)

parseSpeed

public static final Float parseSpeed(String value)
parses a speed value given e.g. for the "maxspeed" key.

Returns:
speed in km/h; null if value had syntax errors

parseMeasure

public static final Float parseMeasure(String value)
parses a measure value given e.g. for the "width" or "length" key.

Returns:
measure in m; null if value had syntax errors

parseWeight

public static Float parseWeight(String value)
parses a weight value given e.g. for the "maxweight" or "maxaxleload" key.

Returns:
weight in t; null if value had syntax errors

parseIncline

public static final Float parseIncline(String value)
parses an incline value as given for the "incline" key.

Returns:
incline in percents; null if value had syntax errors

parseAngle

public static final Float parseAngle(String value)
parses an angular value as given for the "direction" key.

Returns:
angle in degrees measured from north, range [0, 360[; null if value had syntax errors

parseColor

public static final Color parseColor(String value)
parses an hexadecimal color value

Returns:
color; null if value had syntax errors