Class LegacyConverter

java.lang.Object
gov.usgs.earthquake.eids.LegacyConverter

public class LegacyConverter extends Object
Utility class to translate between Quakeml, EQXML, and CUBE formats.
  • Field Details

  • Constructor Details

    • LegacyConverter

      public LegacyConverter(LegacyConverter.Format outputFormat)
      Constructor
      Parameters:
      outputFormat - format you want to switch to
  • Method Details

    • cubeConverter

      public static LegacyConverter cubeConverter()
      Returns:
      converter that outputs cube.
    • eqxmlConverter

      public static LegacyConverter eqxmlConverter()
      Returns:
      converter that outputs eqxml.
    • quakemlConverter

      public static LegacyConverter quakemlConverter()
      Returns:
      converter that outputs quakeml.
    • convert

      public byte[] convert(Product product) throws Exception
      Handles conversion from a product containing either eqxml or quakeml contents to either eqxml, quakeml, or cube byte array.
      Parameters:
      product - the product object to convert.
      Returns:
      byte array containing the output format, or null if unable to convert.
      Throws:
      Exception - if error occurs
    • convert

      public byte[] convert(gov.usgs.ansseqmsg.EQMessage eqxml) throws Exception
      Handles conversion from an eqxml to either eqxml, quakeml, or cube byte array.
      Parameters:
      eqxml - the eqxml object to convert.
      Returns:
      byte array containing output format, or null if unable to convert.
      Throws:
      Exception - if error occurs
    • convert

      public byte[] convert(org.quakeml_1_2.Quakeml quakeml) throws Exception
      Handles conversion from a quakeml message to either eqxml, quakeml, or cube byte array.
      Parameters:
      quakeml - the quakeml object to convert.
      Returns:
      byte array containing output format, or null if unable to convert.
      Throws:
      Exception - if error occurs
    • convert

      public byte[] convert(gov.usgs.earthquake.cube.CubeMessage cube) throws Exception
      Handles conversion from a cube message to either eqxml, quakeml, or cube byte array.
      Parameters:
      cube - the cube object to convert.
      Returns:
      byte array containing output format, or null if unable to convert.
      Throws:
      Exception - if error occurs