public class LWRComponent extends java.lang.Object implements IReactorComponent, IDataProvider, IHdfWriteable, IHdfReadable
The LWRComponent class represents all reactor components that can be stored in a LWRComposite. This class should be treated as an extension of the Java Object class where identifying pieces of information are stored on this object. This class also implements the IDataProvider interface in order to provide state point data capabilities for individual, unique instances of this extended class. A key note to understand about this implementation for IDataProvider is that for individual changes on a particular position, say a Rod at a at a certain coordinate within an assembly changes it's material density, then this data should be stored at a higher level within the LWRDataProvider on the Assembly. The IDataProvider implementation here is designed specifically for showing changes across all named positions of the same type. If ,for example, the data changed across the same assembly across all of the same rod types, then the statepoint data should be stored on this class.
This class implements the ICE Component interface.
iComponentVisitor
iComponentListener
Constructor and Description |
---|
LWRComponent()
The nullary Constructor.
|
LWRComponent(java.lang.String name)
A parameterized Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(IComponentVisitor visitor)
This operation directs the Component to call back to an IComponentVisitor
so that the visitor can perform its required actions for the exact type
of the Component.
|
void |
accept(ILWRComponentVisitor visitor)
This operation accepts an ILWRComponentVisitor that can be visit the
LWRComponent to ascertain its type and perform various type-specific
operations.
|
void |
addData(LWRData data,
double time)
Adds a IData piece, keyed on the feature and timeStep, to the dataTree.
|
java.lang.Object |
clone()
Deep copies and returns a newly instantiated object.
|
void |
copy(LWRComponent otherObject)
Deep copies the contents of the object.
|
ncsa.hdf.object.h5.H5Group |
createGroup(ncsa.hdf.object.h5.H5File h5File,
ncsa.hdf.object.h5.H5Group parentH5Group)
This operation creates and returns a child H5Group for the parentH5Group
in the h5File.
|
boolean |
equals(java.lang.Object otherObject)
This operation is used to check equality between the ICE and another
Identifiable entity.
|
double |
getCurrentTime()
Returns the current time step.
|
java.util.ArrayList<IData> |
getDataAtCurrentTime(java.lang.String feature)
This operation returns all of the data (as IData[*]) related to a particular feature for this provider at a specific time step.
|
java.lang.String |
getDescription()
This operation retrieves the description of the Identifiable entity.
|
java.util.ArrayList<java.lang.String> |
getFeatureList()
This operation returns the list of features available across all time steps (pin-power, temperature, etc).
|
java.util.ArrayList<java.lang.String> |
getFeaturesAtCurrentTime()
Returns the list of features at the current time.
|
HDF5LWRTagType |
getHDF5LWRTag()
Returns the LWRComponentType.
|
int |
getId()
This operation retrieves the identification number of the Identifiable
entity.
|
java.lang.String |
getName()
This operation retrieves the name of the Identifiable entity.
|
int |
getNumberOfTimeSteps()
This operation returns the total number of time steps.
|
java.lang.String |
getSourceInfo()
This operation is a description of the source of information for this provider and its data.
|
java.util.ArrayList<java.lang.Double> |
getTimes()
Returns all the times in ascending order.
|
int |
getTimeStep(double time)
Returns the integer time based upon the time step.
|
java.lang.String |
getTimeUnits()
Returns the time units.
|
java.util.ArrayList<IHdfWriteable> |
getWriteableChildren()
This operation returns an ArrayList of IHdfWriteable child objects.
|
int |
hashCode()
This operation returns the hashcode value of the Identifiable entity.
|
boolean |
readAttributes(ncsa.hdf.object.h5.H5Group h5Group)
This operation reads Attributes from h5Group and assigns their values to
class variables.
|
boolean |
readChild(IHdfReadable iHdfReadable)
This operation assigns the reference of the provided iHdfReadable to a
class variable.
|
boolean |
readDatasets(ncsa.hdf.object.h5.H5Group h5Group)
This operation reads Datasets from h5Group and assigns their values to
class variables.
|
void |
register(IUpdateableListener listener)
This operation registers a listener that realizes the IUpdateableListener
interface with the IUpdateable so that it can receive notifications of
changes to the IUpdateable if they are published.
|
void |
removeAllDataFromFeature(java.lang.String feature)
Removes the feature and all associated IData from the dataTree at all
time steps.
|
void |
setDescription(java.lang.String description)
This operation sets the description of the Identifiable entity.
|
void |
setId(int id)
This operation sets the identification number of the Identifiable entity.
|
void |
setName(java.lang.String name)
This operation sets the name of the Identifiable entity.
|
void |
setSourceInfo(java.lang.String sourceInfo)
Sets the sourceInfo.
|
void |
setTime(double step)
This operation sets the current time step for which data should be retrieved.
|
void |
setTimeUnits(java.lang.String timeUnit)
Sets the time units.
|
java.lang.String |
toString()
This operation returns the contents of the ILWRComponent as a string.
|
void |
unregister(IUpdateableListener listener)
This operation unregisters a listener that realizes the
IUpdateableListener interface with the IUpdateable so that it will no
longer receive notifications of changes to the IUpdateable if they are
published.
|
void |
update(java.lang.String updatedKey,
java.lang.String newValue)
This operation notifies a class that has implemented IUpdateable that the
value associated with the particular key has been updated.
|
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.
|
public LWRComponent()
public LWRComponent(java.lang.String name)
name
- Name of this LWRComponentpublic void setSourceInfo(java.lang.String sourceInfo)
Sets the sourceInfo. Can not be null or the empty string. Strings passed will be trimmed before being set.
sourceInfo
- The sourceInfo to set.
public void addData(LWRData data, double time)
Adds a IData piece, keyed on the feature and timeStep, to the dataTree. If the feature exists in the tree, it will append to the end of the list.
data
- The data to add.
time
- public void removeAllDataFromFeature(java.lang.String feature)
Removes the feature and all associated IData from the dataTree at all time steps. If a user wishes to remove a single piece of IData from the tree, then use the appropriate getData operation on that feature and manipulate the data that way.
feature
- The feature.
public void setId(int id)
Identifiable
This operation sets the identification number of the Identifiable entity. It must be greater than zero.
setId
in interface Identifiable
id
- The unique identification number that should be assigned to the Identifiable entity.
public java.lang.String getDescription()
Identifiable
This operation retrieves the description of the Identifiable entity.
getDescription
in interface Identifiable
The description of the Identifiable entity.
public int getId()
Identifiable
This operation retrieves the identification number of the Identifiable entity.
getId
in interface Identifiable
The unique identification number of the Identifiable entity.
public void setName(java.lang.String name)
Identifiable
This operation sets the name of the Identifiable entity.
setName
in interface Identifiable
name
- The name that should be given to the Identifiable entity.
public java.lang.String getName()
Identifiable
This operation retrieves the name of the Identifiable entity.
getName
in interface Identifiable
The name of the Identifiable entity.
public void setDescription(java.lang.String description)
Identifiable
This operation sets the description of the Identifiable entity.
setDescription
in interface Identifiable
description
- The description that should be stored for the Identifiable entity.
public boolean equals(java.lang.Object otherObject)
Identifiable
This operation is used to check equality between the ICE and another Identifiable entity. It returns true if the Identifiable entities are equal and false if they are not.
equals
in interface Identifiable
equals
in class java.lang.Object
otherObject
- The other Identifiable entity that should be compared with this one.
True if the Identifiable entitys are equal, false otherwise.
public int hashCode()
Identifiable
This operation returns the hashcode value of the Identifiable entity.
hashCode
in interface Identifiable
hashCode
in class java.lang.Object
The hashcode of the Identifiable entity.
public void update(java.lang.String updatedKey, java.lang.String newValue)
IUpdateable
This operation notifies a class that has implemented IUpdateable that the value associated with the particular key has been updated.
update
in interface IUpdateable
updatedKey
- A unique key that describes the value that to be updated.
newValue
- The updated value of the key.
public void register(IUpdateableListener listener)
IUpdateable
This operation registers a listener that realizes the IUpdateableListener interface with the IUpdateable so that it can receive notifications of changes to the IUpdateable if they are published.
register
in interface IUpdateable
listener
- The new listener that should be notified when the the Component's state changes.
public void accept(IComponentVisitor visitor)
Component
This operation directs the Component to call back to an IComponentVisitor so that the visitor can perform its required actions for the exact type of the Component.
public java.lang.String toString()
IReactorComponent
This operation returns the contents of the ILWRComponent as a string.
toString
in interface IReactorComponent
toString
in class java.lang.Object
The contents of the LWRComponent as a string.
public java.util.ArrayList<java.lang.String> getFeatureList()
IDataProvider
This operation returns the list of features available across all time steps (pin-power, temperature, etc).
getFeatureList
in interface IDataProvider
The list of features.
public int getNumberOfTimeSteps()
IDataProvider
This operation returns the total number of time steps.
getNumberOfTimeSteps
in interface IDataProvider
The number of time steps.
public void setTime(double step)
IDataProvider
This operation sets the current time step for which data should be retrieved. It is 0-indexed such that time step 0 is the initial state and time step 1 is the state after the first time step. This operation should be called to set the current time step before data is retrieved from the provider. The provider will always default to the initial state.
setTime
in interface IDataProvider
step
- The time step to set.
public java.util.ArrayList<IData> getDataAtCurrentTime(java.lang.String feature)
IDataProvider
This operation returns all of the data (as IData[*]) related to a particular feature for this provider at a specific time step.
This operation will return null if no data is available and such a situation will most likely signify an error.
getDataAtCurrentTime
in interface IDataProvider
feature
- The feature for the IData.
The returned IData.
public java.lang.String getSourceInfo()
IDataProvider
This operation is a description of the source of information for this provider and its data.
getSourceInfo
in interface IDataProvider
The source information.
public java.util.ArrayList<java.lang.String> getFeaturesAtCurrentTime()
IDataProvider
Returns the list of features at the current time.
getFeaturesAtCurrentTime
in interface IDataProvider
The returned list of features at the current time step.
public java.util.ArrayList<java.lang.Double> getTimes()
IDataProvider
Returns all the times in ascending order.
getTimes
in interface IDataProvider
An arraylist of times in order from least to greatest. This operation does not allow the user to change the order of this list.
public int getTimeStep(double time)
IDataProvider
Returns the integer time based upon the time step. Returns -1 if the time does not exist.
getTimeStep
in interface IDataProvider
public java.lang.String getTimeUnits()
IDataProvider
Returns the time units.
getTimeUnits
in interface IDataProvider
The time unit.
public ncsa.hdf.object.h5.H5Group createGroup(ncsa.hdf.object.h5.H5File h5File, ncsa.hdf.object.h5.H5Group parentH5Group)
IHdfWriteable
This operation creates and returns a child H5Group for the parentH5Group in the h5File. If h5File is null or can not be opened, then null is returned. If parentH5Group is null, then null is returned. If an exception is thrown, then null is returned.
createGroup
in interface IHdfWriteable
h5File
- The H5File.
parentH5Group
- The parent H5Group.
The new H5Group.
public java.util.ArrayList<IHdfWriteable> getWriteableChildren()
IHdfWriteable
This operation returns an ArrayList of IHdfWriteable child objects. If this IHdfWriteable has no IHdfWriteable child objects, then null is returned.
getWriteableChildren
in interface IHdfWriteable
An ArrayList of IHdfWriteable child objects.
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
h5File
- The H5File.
h5Group
- The H5Group to write Attributes to.
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.
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
h5File
- The H5File.
h5Group
- The H5Group to write Datasets to.
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.
public boolean readChild(IHdfReadable iHdfReadable)
IHdfReadable
This operation assigns the reference of the provided iHdfReadable to a class variable. If iHdfReadable is null, then false is returned. If iHdfReadable fails casting, then false is returned. Otherwise, true is returned.
readChild
in interface IHdfReadable
iHdfReadable
- The IHdfReadable whose reference is to be cast and assigned to a class variable.
If iHdfReadable is null, then false is returned. If iHdfReadable fails casting, then false is returned. Otherwise, true is returned.
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
h5Group
- The H5Group to read Attributes from.
If h5Group is null, false is returned. If any Attribute values are null, false is returned. Otherwise, true is returned.
public boolean readDatasets(ncsa.hdf.object.h5.H5Group h5Group)
IHdfReadable
This operation reads Datasets from h5Group and assigns their values to class variables. If h5Group is null or an Exception is thrown, false is returned. If the Otherwise, true is returned.
readDatasets
in interface IHdfReadable
h5Group
- The H5Group to read Datasets from.
If h5Group is null or an Exception is thrown, false is returned. If the Otherwise, true is returned.
public double getCurrentTime()
Returns the current time step.
The current time step.
public HDF5LWRTagType getHDF5LWRTag()
Returns the LWRComponentType.
The LWRComponentType.
public void copy(LWRComponent 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 java.lang.Object
The newly instantiated copied object.
public void setTimeUnits(java.lang.String timeUnit)
Sets the time units.
timeUnit
- The time unit to be set.
public void accept(ILWRComponentVisitor visitor)
This operation accepts an ILWRComponentVisitor that can be visit the LWRComponent to ascertain its type and perform various type-specific operations.
visitor
- The visitor
public void unregister(IUpdateableListener listener)
IUpdateable
This operation unregisters a listener that realizes the IUpdateableListener interface with the IUpdateable so that it will no longer receive notifications of changes to the IUpdateable if they are published.
unregister
in interface IUpdateable
listener
- The listener that should no longer receive updates.