public class GridLocation extends java.lang.Object implements java.lang.Comparable<GridLocation>
The GridLocation class represents a location on a Cartesian grid. This class also stores an implementation of the IDataProvider, called LWRDataProvider. This class was designed with two specific roles in mind.
1.) To provide a wrapper for Rows and Columns (i, j or x, y) on a cartesean grid.
2.) To provide state point data at particular positions within a grid.
As 1.) is easy to understand, 2.) is a bit complex. To optimize memory efficiency, the LWRDataProvider should be used to represent changes in statepointdata at a particular position for a specific type of delegated sub component.
For example, in most reactors there are only about 3-5 different types of "Rods" used within a reaction. On an assembly, these rods are used multiple times for different positions. These rods also contain materials that decompose over a reaction's lifetime. For a 17x17 assembly, it is a waste of memory to store 17x17 amount of rods for each location along with unique state point data (LWRDataProvider) for each rod (especially if most of them are the same type of rod). It is preferred to store 5 rods and to set their positions based on name within that assembly and to change the statepoint data on the assembly through this class over the life cycle of the reaction. This improves memory efficiency and separates the model from the "experimental data".
Keep in mind, you can do both. However, the second method improves IO times in magnitudes and is more optimal.
Constructor and Description |
---|
GridLocation(int row,
int col)
The Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Deep copies and returns a newly instantiated object.
|
int |
compareTo(GridLocation location)
(non-Javadoc)
|
void |
copy(GridLocation 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.
|
int |
getColumn()
Returns the column position.
|
LWRDataProvider |
getLWRDataProvider()
Returns the LWRDataProvider.
|
int |
getRow()
Returns the row position.
|
int |
hashCode()
Returns the hashCode of the object.
|
void |
setLWRDataProvider(LWRDataProvider dataProvider)
Sets the LWRDataProvider.
|
public GridLocation(int row, int col)
The Constructor.
row
- The row position.
col
- The column position.
public int getRow()
Returns the row position.
The row position.
public int getColumn()
Returns the column position.
The column position.
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 class java.lang.Object
otherObject
- The object to be compared.
True if otherObject is equal. False otherwise.
public int hashCode()
Returns the hashCode of the object.
hashCode
in class java.lang.Object
The hash of the object.
public void copy(GridLocation 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 class java.lang.Object
The newly instantiated copied object.
public void setLWRDataProvider(LWRDataProvider dataProvider)
Sets the LWRDataProvider.
dataProvider
- The IDataProvider implementation.
public LWRDataProvider getLWRDataProvider()
Returns the LWRDataProvider.
The IDataProvider implementation.
public int compareTo(GridLocation location)
compareTo
in interface java.lang.Comparable<GridLocation>
Comparable.compareTo(Object arg0)