Package gov.usgs.earthquake.shakemap
Class GridXYZHandler
- java.lang.Object
-
- gov.usgs.earthquake.shakemap.GridXYZHandler
-
public class GridXYZHandler extends java.lang.Object
Parser for ShakeMap grid.xyz metadata. id magnitude latitude longitude month day year hour:minute:second timezone lonMin latMin lonMax latMax (Process time: dow month day hour:minute:second year) eventDescription 2009232_290541 4.2 41.94 -114.09 AUG 20 2009 06:44:11 GMT -115.327 41.0306 -112.844 42.8806 (Process time: Wed Aug 19 23:55:49 2009) 73.1 miles NE of WELLS-NV
-
-
Field Summary
Fields Modifier and Type Field Description static java.text.SimpleDateFormat
EVENT_TIMESTAMP_FORMAT
Format for event timesstatic java.text.SimpleDateFormat
PROCESS_TIMESTAMP_FORMAT
Format for process times
-
Constructor Summary
Constructors Constructor Description GridXYZHandler(ShakeMap shakemap)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ShakeMap
getShakemap()
protected java.lang.String
join(java.lang.String delimeter, java.lang.String[] parts)
Appends a string array of parts with a delimeter inbetweenvoid
parse(java.io.InputStream in)
Read first line of grid.xyz file and set properties on ShakeMap object.void
setShakemap(ShakeMap shakemap)
-
-
-
Constructor Detail
-
GridXYZHandler
public GridXYZHandler(ShakeMap shakemap)
Constructor- Parameters:
shakemap
- a shakemap
-
-
Method Detail
-
getShakemap
public ShakeMap getShakemap()
- Returns:
- shakemap
-
setShakemap
public void setShakemap(ShakeMap shakemap)
- Parameters:
shakemap
- to set
-
parse
public void parse(java.io.InputStream in) throws java.lang.Exception
Read first line of grid.xyz file and set properties on ShakeMap object.- Parameters:
in
- the grid.xyz input stream.- Throws:
java.lang.Exception
- if error occurs
-
join
protected java.lang.String join(java.lang.String delimeter, java.lang.String[] parts)
Appends a string array of parts with a delimeter inbetween- Parameters:
delimeter
- to add between partsparts
- string array to combine- Returns:
- A string of delimited parts
-
-