public class PressurizedWaterReactor extends LWReactor
The PressurizedWaterReactor (PWReactor) class represents any Pressurized Water Reactor. This class extends the LWReactor and provides a defined utility for representing a PWReactor. It can store specific assemblies in their own grids, so that one type of assembly can share the same position as another type.
Keep in mind although there are many ways to prevent erroneous PressurizedWaterReactors from being built, this class should not manage the deeper logic behind building a reactor. For example, there is no logic to stop a user from setting all assemblies in all locations (although it does have logic to stop two assemblies of the same type to be stored at the same location). The deeper types of logic are up to the user of this class who delegates the conversion between their reactor model to this model. This is to allow flexibility and portability to many applications so that other users can apply this model to earlier or later versions of a PressurizedWaterReactor with minimal restrictions.
Please note that when the add<Component>() operation is used, if a <Component> with the same name exists in the <Component> collection, then the <Component> will not be added. When using the set<Component>Location() operation, if a <Component>with the same name exists at the provided location, then the current <Component> name at the provided location will be overwritten. Here, <Component> can be (but not limited to) "ControlBanks", "FuelAssembly", "IncoreInstrument", or "RodClusterAssembly". Please check the enumeration called AssemblyTypes for a complete list of Assemblies that could be managed by this class.
iComponentVisitor
iComponentListener
Constructor and Description |
---|
PressurizedWaterReactor()
A default constructor that should ONLY be used for persistence and
testing.
|
PressurizedWaterReactor(int size)
A parameterized Constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
boolean |
addAssembly(AssemblyType type,
LWRComponent assembly)
This operation adds an assembly of the specified AssemblyType to the
reactor and return true.
|
java.lang.Object |
clone()
Deep copies and returns a newly instantiated object.
|
void |
copy(PressurizedWaterReactor 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.
|
LWRComponent |
getAssemblyByLocation(AssemblyType type,
int row,
int column)
Returns the assembly of the specified type at the specified column and
row in the reactor or null if one is not found at the provided location.
|
LWRComponent |
getAssemblyByName(AssemblyType type,
java.lang.String name)
Returns the assembly of the specified type with the provided name or null
if an assembly of that type and name does not exist.
|
LWRDataProvider |
getAssemblyDataProviderAtLocation(AssemblyType type,
int row,
int column)
Returns the data provider for the assembly of the specified type at the
given location or null if it does not exist.
|
java.util.ArrayList<java.lang.String> |
getAssemblyNames(AssemblyType type)
Returns an list of names for each assembly in the reactor of the
specified type.
|
double |
getFuelAssemblyPitch()
Returns the distance between assemblies in the core, determined by the
seating location in the core plates.
|
GridLabelProvider |
getGridLabelProvider()
Returns the GridLabelProvider for this PWReactor.
|
int |
getNumberOfAssemblies(AssemblyType type)
This operation returns the number of assemblies of the specified type.
|
int |
getSize()
Returns the number of fuel assemblies across the core.
|
java.util.ArrayList<IHdfWriteable> |
getWriteableChildren()
This operation returns an ArrayList of IHdfWriteable child objects.
|
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 |
readChild(IHdfReadable iHdfReadable)
This operation returns an ArrayList of IHdfReadable child objects.
|
boolean |
removeAssembly(AssemblyType type,
java.lang.String assemblyName)
Removes an assembly of the specified type from the collection of
assemblies.
|
boolean |
removeAssemblyFromLocation(AssemblyType type,
int row,
int column)
Removes the assembly at the provided location and of the specified if it
exists.
|
boolean |
setAssemblyLocation(AssemblyType type,
java.lang.String assemblyName,
int row,
int column)
Sets the location for the assembly of the specified type with the
provided name.
|
void |
setFuelAssemblyPitch(double fuelAssemblyPitch)
Sets the distance between assemblies in the core, determined by the
seating location in the core plates.
|
void |
setGridLabelProvider(GridLabelProvider gridLabelProvider)
Sets the GridLabelProvider for this PWReactor.
|
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.
|
addComponent, copy, removeComponent, removeComponent
copy, getComponent, getComponent, getComponentNames, getComponents, getNumberOfComponents
accept, addData, copy, createGroup, getCurrentTime, getDataAtCurrentTime, getDescription, getFeatureList, getFeaturesAtCurrentTime, getHDF5LWRTag, getId, getName, getNumberOfTimeSteps, getSourceInfo, getTimes, getTimeStep, getTimeUnits, readDatasets, register, removeAllDataFromFeature, setDescription, setId, setName, setSourceInfo, setTime, setTimeUnits, toString, unregister, update, writeDatasets
register, unregister, update
getDescription, getId, getName, setDescription, setId, setName
public PressurizedWaterReactor()
public PressurizedWaterReactor(int size)
A parameterized Constructor.
size
- The number of fuel assemblies across the core.
public int getSize()
Returns the number of fuel assemblies across the core.
public GridLabelProvider getGridLabelProvider()
Returns the GridLabelProvider for this PWReactor.
The GridLabelProvider for this PWReactor.
public void setGridLabelProvider(GridLabelProvider gridLabelProvider)
Sets the GridLabelProvider for this PWReactor.
gridLabelProvider
- The GridLabelProvider for this FuelAssembly.
public double getFuelAssemblyPitch()
Returns the distance between assemblies in the core, determined by the seating location in the core plates.
The distance between assemblies in the core, determined by the seating location in the core plates.
public void setFuelAssemblyPitch(double fuelAssemblyPitch)
Sets the distance between assemblies in the core, determined by the seating location in the core plates.
fuelAssemblyPitch
- The distance between assemblies in the core, determined by the seating location in the core plates.
public boolean readAttributes(ncsa.hdf.object.h5.H5Group h5Group)
This operation reads Attributes from h5Group and assigns their values to class variables. If h5Group is null, false is returned. Otherwise, true is returned.
readAttributes
in interface IHdfReadable
readAttributes
in class LWReactor
h5Group
- 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 LWReactor
h5File
- h5Group
- 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 LWReactor
otherObject
- The object to be compared.
True if otherObject is equal. False otherwise.
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
getWriteableChildren
in class LWRComposite
public boolean readChild(IHdfReadable iHdfReadable)
This operation returns an ArrayList of IHdfReadable child objects. If this IHdfReadable has no IHdfReadable child objects, then null is returned.
readChild
in interface IHdfReadable
readChild
in class LWRComposite
iHdfReadable
- public int hashCode()
Returns the hashCode of the object.
hashCode
in interface Identifiable
hashCode
in class LWReactor
The hash of the object.
public void copy(PressurizedWaterReactor 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 LWReactor
The newly instantiated copied object.
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.
accept
in class LWRComponent
visitor
- The visitor
public boolean addAssembly(AssemblyType type, LWRComponent assembly)
This operation adds an assembly of the specified AssemblyType to the reactor and return true. If an assembly of the same name and type already exists in the reactor, then the new assembly will not be added and this operation will return false.
type
- The type of the assembly.
assembly
- The assembly to add to the collection of FuelAssemblies.
True, if the assembly was added successfully.
public boolean removeAssembly(AssemblyType type, java.lang.String assemblyName)
Removes an assembly of the specified type from the collection of assemblies. Returns true if the operation was successful, false otherwise.
type
- The type of the assembly.
assemblyName
- The name of the assembly to be removed.
True, if the assembly was removed successfully.
public java.util.ArrayList<java.lang.String> getAssemblyNames(AssemblyType type)
Returns an list of names for each assembly in the reactor of the specified type.
type
- The type of the assembly.
An ArrayList of names for each element of the collection of assemblies.
public LWRComponent getAssemblyByName(AssemblyType type, java.lang.String name)
Returns the assembly of the specified type with the provided name or null if an assembly of that type and name does not exist.
type
- The type of the assembly.
name
- The name of the assembly to find.
The assembly
public LWRComponent getAssemblyByLocation(AssemblyType type, int row, int column)
Returns the assembly of the specified type at the specified column and row in the reactor or null if one is not found at the provided location.
type
- The type of the assembly.
row
- The row id.
column
- The column id.
The assembly corresponding to the provided type, column and row or null if one is not found at the provided location.
public boolean setAssemblyLocation(AssemblyType type, java.lang.String assemblyName, int row, int column)
Sets the location for the assembly of the specified type with the provided name. Overrides the location of another assembly as required. Returns true if this operation was successful, false otherwise. Note it will return true if the same name is overridden.
type
- The type of the assembly.
assemblyName
- The name of the assembly.
row
- The row id.
column
- The column id.
True, if the location of the assembly was set successfully.
public boolean removeAssemblyFromLocation(AssemblyType type, int row, int column)
Removes the assembly at the provided location and of the specified if it exists. Returns true if the removal was successful, false otherwise.
type
- The type of the assembly.
row
- The row id.
column
- The column id.
True, if the assembly removal was successful.
public LWRDataProvider getAssemblyDataProviderAtLocation(AssemblyType type, int row, int column)
Returns the data provider for the assembly of the specified type at the given location or null if it does not exist.
type
- The type of the assembly.
row
- The row id.
column
- The column id.
The DataProvider that manages state point data for the specified assembly.
public int getNumberOfAssemblies(AssemblyType type)
This operation returns the number of assemblies of the specified type.
type
- The type of the assembly.
The number of assemblies of the specified type.