Package gov.usgs.earthquake.eids
Class LegacyConverter
- java.lang.Object
-
- gov.usgs.earthquake.eids.LegacyConverter
-
public class LegacyConverter extends java.lang.Object
Utility class to translate between Quakeml, EQXML, and CUBE formats.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LegacyConverter.Format
Different format types
-
Field Summary
Fields Modifier and Type Field Description static LegacyConverter.Format
CUBE
Cube Formatstatic LegacyConverter.Format
EQXML
EQXML Formatstatic java.lang.String
EQXML_CONTENT_PATH
Path to EQXML contentstatic LegacyConverter.Format
QUAKEML
QUAKEML Formatstatic java.lang.String
QUAKEML_CONTENT_PATH
Path to Quakeml content
-
Constructor Summary
Constructors Constructor Description LegacyConverter(LegacyConverter.Format outputFormat)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
convert(gov.usgs.ansseqmsg.EQMessage eqxml)
Handles conversion from an eqxml to either eqxml, quakeml, or cube byte array.byte[]
convert(gov.usgs.earthquake.cube.CubeMessage cube)
Handles conversion from a cube message to either eqxml, quakeml, or cube byte array.byte[]
convert(Product product)
Handles conversion from a product containing either eqxml or quakeml contents to either eqxml, quakeml, or cube byte array.byte[]
convert(org.quakeml_1_2.Quakeml quakeml)
Handles conversion from a quakeml message to either eqxml, quakeml, or cube byte array.static LegacyConverter
cubeConverter()
static LegacyConverter
eqxmlConverter()
static LegacyConverter
quakemlConverter()
-
-
-
Field Detail
-
CUBE
public static final LegacyConverter.Format CUBE
Cube Format
-
EQXML
public static final LegacyConverter.Format EQXML
EQXML Format
-
QUAKEML
public static final LegacyConverter.Format QUAKEML
QUAKEML Format
-
EQXML_CONTENT_PATH
public static final java.lang.String EQXML_CONTENT_PATH
Path to EQXML content- See Also:
- Constant Field Values
-
QUAKEML_CONTENT_PATH
public static final java.lang.String QUAKEML_CONTENT_PATH
Path to Quakeml content- See Also:
- Constant Field Values
-
-
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
-
-