public final class HazardExport extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
add(Hazard hazard,
Optional<Deaggregation> deagg)
Add a Hazard and optional Deaggregation result to this handler.
|
static HazardExport |
create(CalcConfig config,
Sites sites,
Logger log)
Create a new results handler.
|
static Map<Imt,Map<Gmm,XySequence>> |
curvesByGmm(Hazard hazard)
Derive maps of curves by
Gmm for each Imt in a
Hazard result. |
static Map<Imt,Map<SourceType,XySequence>> |
curvesBySource(Hazard hazard)
Derive maps of curves by
SourceType for each Imt. |
String |
elapsedTime()
A string representation of the time duration that this result handler has
been running.
|
void |
expire()
Calls
flush() a final time, stops all timers and sets the state of
this Results instance to 'used'; no more results may be added. |
void |
flush()
Flush any stored Hazard and Deaggregation results to file, clearing
|
Path |
outputDir()
The target output directory established by this handler.
|
int |
resultsProcessed()
The number of hazard [and deagg] results passed to this handler thus far.
|
int |
size()
The number of
Hazard results this handler is currently storing. |
public static HazardExport create(CalcConfig config, Sites sites, Logger log) throws IOException
config - that specifies output options and formatssites - reference to the sites to be processed (not retained)log - shared logging instance from calling classIllegalStateException - if binary output has been specified in the
config but the sites container does not specify map
extents.IOExceptionpublic void add(Hazard hazard, Optional<Deaggregation> deagg) throws IOException
hazard - to adddeagg - to addIOExceptionpublic void flush()
throws IOException
IOExceptionpublic void expire()
throws IOException
flush() a final time, stops all timers and sets the state of
this Results instance to 'used'; no more results may be added.IOExceptionpublic int resultsProcessed()
public int size()
Hazard results this handler is currently storing.public String elapsedTime()
public Path outputDir()
public static Map<Imt,Map<SourceType,XySequence>> curvesBySource(Hazard hazard)
SourceType for each Imt.