public class LWRGridManager extends LWRComponent implements IGridManager
The LWRGridManager class manages LWRComponents and their GridLocations on a Cartesian grid with an equal number of rows and columns. This class implements the ICE IGridManager interface.
This class also allows a "pass through" for LWRDataProviders, which are used to store state point data. This is a preferred method for storing data over time instead of using LWRComponent's IDataProvider directly. Please see GridLocation for more details on the usage of this delegation class.
iComponentVisitor
iComponentListener
Constructor and Description |
---|
LWRGridManager(int size)
The Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addComponent(Component component,
GridLocation location)
(non-Javadoc)
|
java.lang.Object |
clone()
Deep copies and returns a newly instantiated object.
|
void |
copy(LWRGridManager otherObject)
Deep copies the contents of the object.
|
boolean |
equals(java.lang.Object otherObject)
Overrides the equals operation to check the attributes on this object
with another object of the same type.
|
java.lang.String |
getComponentName(GridLocation location)
(non-Javadoc)
|
LWRDataProvider |
getDataProviderAtLocation(GridLocation location)
Returns the data provider at the grid location or null if it does not
exist.
|
java.util.ArrayList<GridLocation> |
getGridLocationsAtName(java.lang.String name)
Returns the list of grid locations at the given name.
|
int |
getSize()
Returns the maximum number of rows or columns.
|
int |
hashCode()
Returns the hashCode of the object.
|
boolean |
readAttributes(ncsa.hdf.object.h5.H5Group h5Group)
This operation reads Attributes from h5Group and assigns their values to
class variables.
|
boolean |
readDatasets(ncsa.hdf.object.h5.H5Group h5Group)
Overrides LWRComponent's readDatasets.
|
void |
removeComponent(Component component)
(non-Javadoc)
|
void |
removeComponent(GridLocation location)
(non-Javadoc)
|
boolean |
writeAttributes(ncsa.hdf.object.h5.H5File h5File,
ncsa.hdf.object.h5.H5Group h5Group)
This operation writes HDF5 Attributes to the metadata of h5Group in the
h5File.
|
boolean |
writeDatasets(ncsa.hdf.object.h5.H5File h5File,
ncsa.hdf.object.h5.H5Group h5Group)
This operation writes HDF5 Datasets to the h5Group in the h5File.
|
accept, accept, addData, copy, createGroup, getCurrentTime, getDataAtCurrentTime, getDescription, getFeatureList, getFeaturesAtCurrentTime, getHDF5LWRTag, getId, getName, getNumberOfTimeSteps, getSourceInfo, getTimes, getTimeStep, getTimeUnits, getWriteableChildren, readChild, register, removeAllDataFromFeature, setDescription, setId, setName, setSourceInfo, setTime, setTimeUnits, toString, unregister, update
public LWRGridManager(int size)
The Constructor.
size
- The maximum number of rows or columns.
public int getSize()
Returns the maximum number of rows or columns.
Returns the maximum number of rows or columns.
public boolean equals(java.lang.Object otherObject)
Overrides the equals operation to check the attributes on this object with another object of the same type. Returns true if the objects are equal. False otherwise.
equals
in interface Identifiable
equals
in class LWRComponent
otherObject
- The object to be compared.
True if otherObject is equal. False otherwise.
public int hashCode()
Returns the hashCode of the object.
hashCode
in interface Identifiable
hashCode
in class LWRComponent
The hash of the object.
public void copy(LWRGridManager otherObject)
Deep copies the contents of the object.
otherObject
- The object to be copied.
public java.lang.Object clone()
Deep copies and returns a newly instantiated object.
clone
in interface Identifiable
clone
in class LWRComponent
The newly instantiated copied object.
public java.lang.String getComponentName(GridLocation location)
getComponentName
in interface IGridManager
location
- A GridLocation.
A Component object to return.
IGridManager.getComponentName(GridLocation location)
public void addComponent(Component component, GridLocation location)
addComponent
in interface IGridManager
component
- A Component object to add.
location
- A GridLocation.
IGridManager.addComponent(Component component, GridLocation
location)
public void removeComponent(GridLocation location)
removeComponent
in interface IGridManager
location
- A GridLocation.
IGridManager.removeComponent(GridLocation location)
public void removeComponent(Component component)
removeComponent
in interface IGridManager
component
- A Component object to remove.
IGridManager.removeComponent(Component component)
public boolean writeAttributes(ncsa.hdf.object.h5.H5File h5File, ncsa.hdf.object.h5.H5Group h5Group)
IHdfWriteable
This operation writes HDF5 Attributes to the metadata of h5Group in the h5File. If the h5Group is null or h5File is null or can not be opened, then false is returned. If the operation fails to write all Attributes, then false is returned. Otherwise, true is returned.
writeAttributes
in interface IHdfWriteable
writeAttributes
in class LWRComponent
h5File
- h5Group
- public boolean writeDatasets(ncsa.hdf.object.h5.H5File h5File, ncsa.hdf.object.h5.H5Group h5Group)
IHdfWriteable
This operation writes HDF5 Datasets to the h5Group in the h5File. If the h5Group is null or h5File is null or can not be opened, then false is returned. If the operation fails to write all Datasets, then false is returned. Otherwise, true is returned.
writeDatasets
in interface IHdfWriteable
writeDatasets
in class LWRComponent
h5File
- h5Group
- public boolean readDatasets(ncsa.hdf.object.h5.H5Group h5Group)
Overrides LWRComponent's readDatasets.
readDatasets
in interface IHdfReadable
readDatasets
in class LWRComponent
h5Group
- public boolean readAttributes(ncsa.hdf.object.h5.H5Group h5Group)
IHdfReadable
This operation reads Attributes from h5Group and assigns their values to class variables. If h5Group is null, false is returned. If any Attribute values are null, false is returned. Otherwise, true is returned.
readAttributes
in interface IHdfReadable
readAttributes
in class LWRComponent
h5Group
- public LWRDataProvider getDataProviderAtLocation(GridLocation location)
Returns the data provider at the grid location or null if it does not exist.
location
- The grid location.
The provider at that location
public java.util.ArrayList<GridLocation> getGridLocationsAtName(java.lang.String name)
Returns the list of grid locations at the given name. If none are found, returns an empty list.
name
- The name
The locations