Package org.vast.swe

Class SWEDataTypeUtils

java.lang.Object
org.vast.swe.SWEDataTypeUtils

public class SWEDataTypeUtils extends Object

Helper methods to read/write complex data types (e.g. unions)

Since:
Dec 14, 2014
  • Constructor Details

    • SWEDataTypeUtils

      public SWEDataTypeUtils()
  • Method Details

    • parseDoubleOrInf

      public static final double parseDoubleOrInf(String text) throws NumberFormatException
      Improves on Java Double.parseDouble() method to include +INF/-INF This is needed because Java Infinity is not allowed by XML schema
      Parameters:
      text - string to decode value from
      Returns:
      decoded value
      Throws:
      NumberFormatException - if argument doesn't contain a valid double string
    • getDoubleOrInfAsString

      public static final String getDoubleOrInfAsString(double val)
      Parameters:
      val -
      Returns:
      String representation of double value as per SWE specification (i.e. actually the XML Schema standard representation for infinity)
    • parseDoubleOrInfOrIsoTime

      public final double parseDoubleOrInfOrIsoTime(String text) throws NumberFormatException
      Allows parsing a double or ISO encoded date/time value
      Parameters:
      text - string to decode value from
      Returns:
      decoded value
      Throws:
      NumberFormatException
    • getDoubleOrTimeAsString

      public final String getDoubleOrTimeAsString(double val, boolean useIso)
    • getStringValue

      public final String getStringValue(SimpleComponent component)
      Retrieve string representation of value of component This will convert to an ISO string for appropriate time components
      Parameters:
      component -
      Returns:
      string representation of component value
    • getStringValue

      protected final String getStringValue(SimpleComponent component, int valIdx)