|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opensha.commons.data.siteData.CachedSiteDataWrapper<Element>
Element - public class CachedSiteDataWrapper<Element>
This is a class that takes and SiteDataAPI class and wraps it to add a cache for faster retrieval of data in situations where the same location may be requested often.
| Field Summary | |
|---|---|
protected static boolean |
D
If true print out debug statements. |
| Fields inherited from interface org.opensha.commons.data.siteData.SiteData |
|---|
TYPE_DEPTH_TO_1_0, TYPE_DEPTH_TO_2_5, TYPE_ELEVATION, TYPE_FLAG_INFERRED, TYPE_FLAG_MEASURED, TYPE_TOPOGRAPHIC_SLOPE, TYPE_VS30, TYPE_WILLS_CLASS, XML_METADATA_NAME |
| Constructor Summary | |
|---|---|
CachedSiteDataWrapper(SiteData<Element> provider)
|
|
CachedSiteDataWrapper(SiteData<Element> provider,
int cacheSize)
|
|
| Method Summary | |
|---|---|
void |
clearCache()
Clear the cache. |
ParameterList |
getAdjustableParameterList()
Returns a list of adjustable parameters. |
SiteDataValue<Element> |
getAnnotatedValue(Location loc)
Get the value, with metadata, at the closest location |
SiteDataValueList<Element> |
getAnnotatedValues(LocationList locs)
Get the values, with metadata, at the closest locations |
Region |
getApplicableRegion()
This gives the applicable region for this data set. |
Location |
getClosestDataLocation(Location loc)
Get the location of the closest data point |
String |
getDataMeasurementType()
Get the measurement type for this data, such as "Measured" or "Inferred" |
String |
getDataType()
Get the data type of this dataset |
String |
getMetadata()
Returns the metadata for this dataset. |
String |
getName()
Get the name of this dataset |
ParameterListEditor |
getParameterListEditor()
Returns an editor for the parameter list. |
double |
getResolution()
This gives the resolution of the dataset in degrees, or 0 for infinite resolution. |
String |
getShortName()
Get the short name of this dataset |
Element |
getValue(Location loc)
Returns the value from the underlying site data object, keeping track of the value in the cache. |
ArrayList<Element> |
getValues(LocationList locs)
Get the value for each location in the given location list |
boolean |
hasDataForLocation(Location loc,
boolean checkValid)
Returns true if there is data for the given site |
boolean |
isValueValid(Element el)
Returns true if the value is valid, and not NaN, N/A, or equivelant for the data type |
void |
parameterChange(ParameterChangeEvent event)
Function that must be implemented by all Listeners for ParameterChangeEvents. |
Element |
toXMLMetadata(Element root)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final boolean D
| Constructor Detail |
|---|
public CachedSiteDataWrapper(SiteData<Element> provider)
public CachedSiteDataWrapper(SiteData<Element> provider,
int cacheSize)
| Method Detail |
|---|
public SiteDataValue<Element> getAnnotatedValue(Location loc)
throws IOException
SiteData
getAnnotatedValue in interface SiteData<Element>IOException
public Element getValue(Location loc)
throws IOException
getValue in interface SiteData<Element>IOExceptionpublic void clearCache()
public ArrayList<Element> getValues(LocationList locs)
throws IOException
SiteData
getValues in interface SiteData<Element>IOExceptionpublic ParameterList getAdjustableParameterList()
SiteData
getAdjustableParameterList in interface SiteData<Element>public Region getApplicableRegion()
SiteData
getApplicableRegion in interface SiteData<Element>
public Location getClosestDataLocation(Location loc)
throws IOException
SiteData
getClosestDataLocation in interface SiteData<Element>IOExceptionpublic String getMetadata()
SiteData
getMetadata in interface SiteData<Element>public String getName()
SiteData
getName in interface NamedgetName in interface SiteData<Element>public ParameterListEditor getParameterListEditor()
SiteData
getParameterListEditor in interface SiteData<Element>public double getResolution()
SiteData
getResolution in interface SiteData<Element>public String getShortName()
SiteData
getShortName in interface SiteData<Element>public String getDataType()
SiteData
getDataType in interface SiteData<Element>public String getDataMeasurementType()
SiteData
getDataMeasurementType in interface SiteData<Element>
public boolean hasDataForLocation(Location loc,
boolean checkValid)
SiteData
hasDataForLocation in interface SiteData<Element>loc - - The locationcheckValid - - Boolean for checking the validity of the value at the specified location
public boolean isValueValid(Element el)
SiteData
isValueValid in interface SiteData<Element>public Element toXMLMetadata(Element root)
toXMLMetadata in interface XMLSaveable
public SiteDataValueList<Element> getAnnotatedValues(LocationList locs)
throws IOException
SiteData
getAnnotatedValues in interface SiteData<Element>IOExceptionpublic void parameterChange(ParameterChangeEvent event)
ParameterChangeListener
parameterChange in interface ParameterChangeListenerevent - The Event which triggered this function call
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||