Class LegacyConverter


  • public class LegacyConverter
    extends java.lang.Object
    Utility class to translate between Quakeml, EQXML, and CUBE formats.
    • Constructor Detail

      • LegacyConverter

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

      • 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 java.lang.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:
        java.lang.Exception - if error occurs
      • convert

        public byte[] convert​(gov.usgs.ansseqmsg.EQMessage eqxml)
                       throws java.lang.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:
        java.lang.Exception - if error occurs
      • convert

        public byte[] convert​(org.quakeml_1_2.Quakeml quakeml)
                       throws java.lang.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:
        java.lang.Exception - if error occurs
      • convert

        public byte[] convert​(gov.usgs.earthquake.cube.CubeMessage cube)
                       throws java.lang.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:
        java.lang.Exception - if error occurs