Package gov.usgs.earthquake.dyfi
Class DYFIProduct
- java.lang.Object
-
- gov.usgs.earthquake.product.Product
-
- gov.usgs.earthquake.dyfi.DYFIProduct
-
public class DYFIProduct extends Product
DYFIProduct object to add additional Product properties based on contents. This subclass of Product provides access to additional DYFI-specific attributes and loads these attributes, as well as additional Product attributes from ShakeMap source XML files.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DYFI_EVENT_XML_ATTACHMENT
References the event_data.xml file in the Productstatic java.lang.String
DYFI_MAX_MMI_ATTRIBUTE
Attribute for max intensity.static java.lang.String
DYFI_MAX_MMI_PROPERTY
Internally set max intensity propertystatic java.lang.String
DYFI_NUM_RESP_ATTRIBUTE
Attribute for number of responses.static java.lang.String
DYFI_NUM_RESP_PROPERTY
Internally set number of responses property-
Fields inherited from class gov.usgs.earthquake.product.Product
DEPTH_PROPERTY, EVENTSOURCE_PROPERTY, EVENTSOURCECODE_PROPERTY, EVENTTIME_PROPERTY, LATITUDE_PROPERTY, LONGITUDE_PROPERTY, MAGNITUDE_PROPERTY, STATUS_DELETE, STATUS_UPDATE, VERSION_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description DYFIProduct(Product product)
Creates a new DYFIProduct using the givenProduct
as a basis.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.math.BigDecimal
getMaxMMI()
int
getNumResponses()
protected void
loadEventXml()
Reads in DYFI Event EXL and parses it into a EventDataXMLHandlervoid
setMaxMMI(java.lang.String maxMMI)
Sets the maximum reported intensity for this event.void
setNumResponses(java.lang.String numResponses)
Set the number of felt reports submitted for this event.-
Methods inherited from class gov.usgs.earthquake.product.Product
addLink, getContents, getDepth, getEventId, getEventSource, getEventSourceCode, getEventTime, getId, getLatitude, getLinks, getLongitude, getMagnitude, getProperties, getSignature, getSignatureVersion, getStatus, getTrackerURL, getVersion, isDeleted, setContents, setDepth, setEventId, setEventSource, setEventSourceCode, setEventTime, setId, setLatitude, setLinks, setLongitude, setMagnitude, setProperties, setSignature, setSignatureVersion, setStatus, setTrackerURL, setVersion, sign, sign, verifySignature, verifySignature, verifySignatureKey
-
-
-
-
Field Detail
-
DYFI_EVENT_XML_ATTACHMENT
public static final java.lang.String DYFI_EVENT_XML_ATTACHMENT
References the event_data.xml file in the Product- See Also:
- Constant Field Values
-
DYFI_NUM_RESP_ATTRIBUTE
public static final java.lang.String DYFI_NUM_RESP_ATTRIBUTE
Attribute for number of responses. Read from XML- See Also:
- Constant Field Values
-
DYFI_MAX_MMI_ATTRIBUTE
public static final java.lang.String DYFI_MAX_MMI_ATTRIBUTE
Attribute for max intensity. Read from XML- See Also:
- Constant Field Values
-
DYFI_NUM_RESP_PROPERTY
public static final java.lang.String DYFI_NUM_RESP_PROPERTY
Internally set number of responses property- See Also:
- Constant Field Values
-
DYFI_MAX_MMI_PROPERTY
public static final java.lang.String DYFI_MAX_MMI_PROPERTY
Internally set max intensity property- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DYFIProduct
public DYFIProduct(Product product)
Creates a new DYFIProduct using the givenProduct
as a basis. The given product must have aDYFI_EVENT_XML_ATTACHMENT
in order to successfully create a DYFIProduct.- Parameters:
product
- The product serving as a basis for this instance.
-
-
Method Detail
-
loadEventXml
protected void loadEventXml()
Reads in DYFI Event EXL and parses it into a EventDataXMLHandler
-
getNumResponses
public int getNumResponses()
- Returns:
- The number of felt reports submitted for this event.
-
setNumResponses
public void setNumResponses(java.lang.String numResponses) throws java.lang.NumberFormatException
Set the number of felt reports submitted for this event.- Parameters:
numResponses
- The new number of submitted felt reports.- Throws:
java.lang.NumberFormatException
- If the givennumResponses
could not be parsed into an integer.
-
getMaxMMI
public java.math.BigDecimal getMaxMMI()
- Returns:
- The maximum reported intensity for this event.
-
setMaxMMI
public void setMaxMMI(java.lang.String maxMMI) throws java.lang.NumberFormatException
Sets the maximum reported intensity for this event.- Parameters:
maxMMI
- The new maximum reported intensity.- Throws:
java.lang.NumberFormatException
- If the givenmaxMMI
could not be parsed into a double.
-
-