public class ReflectorAssembly extends SFRAssembly
Class representing radial reflector assemblies. Differentiated from PinAssembly, as radial reflectors contain solid rods rather than pins.
iComponentVisitor
iComponentListener
Constructor and Description |
---|
ReflectorAssembly(int size)
Parameterized constructor with the size (number of rods) specified.
|
ReflectorAssembly(java.lang.String name,
int size)
Parameterized constructor with the name and size (number of rods)
specified.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(ISFRComponentVisitor visitor)
Overrides the default behavior (ignore) from SFRComponent and implements
the accept operation for this SFRComponent's type.
|
void |
addComponent(Component child)
An operation that overrides the SFRComposite's operation.
|
boolean |
addRod(SFRRod rod)
Adds the specified SFRRod to the Reflector assembly; returns true if the
operation is successful.
|
java.lang.Object |
clone()
Deep copies and returns a newly instantiated object.
|
void |
copy(ReflectorAssembly otherObject)
Deep copies the contents of the object from another 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.
|
SFRComponent |
getDataProviderByLocation(int row,
int column)
Returns an IDataProvider for the location in the assembly.
|
int |
getNumberOfRods()
Returns the number of rods in the assembly.
|
SFRRod |
getRodByLocation(int row,
int column)
Returns the SFRRod at the specified location (x, y coordinates) in the
assembly.
|
SFRRod |
getRodByName(java.lang.String name)
Returns the SFRRod with the specified name in the assembly.
|
java.util.ArrayList<java.lang.Integer> |
getRodLocations(java.lang.String name)
Returns an ArrayList of locations within the assembly that are occupied
by the rod matching the specified name.
|
java.util.ArrayList<java.lang.String> |
getRodNames()
Returns a String ArrayList of all rod names contained within the
assembly.
|
double |
getRodPitch()
Returns the rod pitch (shortest distance from rod center to an adjacent
rod center) as a double.
|
int |
hashCode()
Returns the hashCode of the object.
|
void |
removeComponent(int childId)
An operation that overrides the SFRComposite's operation.
|
void |
removeComponent(java.lang.String name)
An operation that overrides the SFRComposite's operation.
|
boolean |
removeRod(java.lang.String name)
Removes the rod with the specified name from the ReflectorAssembly;
returns true if the operation is successful.
|
boolean |
removeRodFromLocation(int row,
int column)
Removes the rod with the specified location (x, y coordinates) from the
ReflectorAssembly; returns true operation is successful.
|
boolean |
setRodLocation(java.lang.String name,
int row,
int column)
Adds the rod with the specified name to the assembly in the specified
location.
|
void |
setRodPitch(double rodPitch)
Sets the rod pitch (shortest distance from rod center to an adjacent rod
center).
|
copy, getAssemblyType, getDuctThickness, getSize, setDuctThickness
copy, getComponent, getComponent, getComponentNames, getComponents, getNumberOfComponents
accept, addData, copy, getCurrentTime, getDataAtCurrentTime, getDescription, getFeatureList, getFeaturesAtCurrentTime, getId, getName, getNumberOfTimeSteps, getSourceInfo, getTimes, getTimeStep, getTimeUnits, notifyListeners, register, removeDataFromFeature, setDescription, setId, setName, setSourceInfo, setTime, setTimeUnits, toString, unregister, update
register, unregister, update
getDescription, getId, getName, setDescription, setId, setName
public ReflectorAssembly(int size)
Parameterized constructor with the size (number of rods) specified.
size
- Size (number of rods) of the assembly.public ReflectorAssembly(java.lang.String name, int size)
Parameterized constructor with the name and size (number of rods) specified.
name
- Name of the assembly.size
- Size (number of rods) of the assembly.public void setRodPitch(double rodPitch)
Sets the rod pitch (shortest distance from rod center to an adjacent rod center).
rodPitch
- The rod pitch. Must be non-negative.public double getRodPitch()
Returns the rod pitch (shortest distance from rod center to an adjacent rod center) as a double.
public boolean addRod(SFRRod rod)
Adds the specified SFRRod to the Reflector assembly; returns true if the operation is successful.
rod
- The rod to be added to the assembly.public boolean setRodLocation(java.lang.String name, int row, int column)
Adds the rod with the specified name to the assembly in the specified location. If the rod exists and the location is valid and is not occupied by the same rod, this returns true.
name
- The name of the rod to set. The name must correspond to an
existing rod.row
- The row in which to put the rod.column
- The column in which to put the rod.public boolean removeRod(java.lang.String name)
Removes the rod with the specified name from the ReflectorAssembly; returns true if the operation is successful.
name
- The name of the rod to remove.public boolean removeRodFromLocation(int row, int column)
Removes the rod with the specified location (x, y coordinates) from the ReflectorAssembly; returns true operation is successful.
row
- The row in which the rod is located.column
- The column in which the rod is located.public java.util.ArrayList<java.lang.String> getRodNames()
Returns a String ArrayList of all rod names contained within the assembly.
public SFRRod getRodByName(java.lang.String name)
Returns the SFRRod with the specified name in the assembly.
name
- The name of the rod to be searched for.public SFRRod getRodByLocation(int row, int column)
Returns the SFRRod at the specified location (x, y coordinates) in the assembly.
row
- The row in which the rod is located.column
- The column in which the rod is located.public java.util.ArrayList<java.lang.Integer> getRodLocations(java.lang.String name)
Returns an ArrayList of locations within the assembly that are occupied by the rod matching the specified name.
name
- The name of the rod being searched for.public int getNumberOfRods()
Returns the number of rods in the assembly.
public SFRComponent getDataProviderByLocation(int row, int column)
Returns an IDataProvider for the location in the assembly. This is distinct from the SFRRod, which, as an SFRComponent, is itself an IDataProvider.
row
- The row in which the IDataProvider is located.column
- The column in which the IDataProvider is located.public void addComponent(Component child)
An operation that overrides the SFRComposite's operation. This operation does nothing and requires that the appropriate, more defined, associated operation to be utilized on this class.
addComponent
in interface Composite
addComponent
in class SFRComposite
child
- The Component that should be added to the Composite.Composite.addComponent(Component child)
public void removeComponent(int childId)
An operation that overrides the SFRComposite's operation. This operation does nothing and requires that the appropriate, more defined, associated operation to be utilized on this class.
removeComponent
in interface Composite
removeComponent
in class SFRComposite
childId
- The ID of the child Component to remove.Composite.removeComponent(int childId)
public void removeComponent(java.lang.String name)
An operation that overrides the SFRComposite's operation. This operation does nothing and requires that the appropriate, more defined, associated operation to be utilized on this class.
removeComponent
in class SFRComposite
name
- The name of the child Component to remove.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 SFRAssembly
otherObject
- The object to be compared.Identifiable.equals(Object otherObject)
public int hashCode()
Returns the hashCode of the object.
hashCode
in interface Identifiable
hashCode
in class SFRAssembly
The hash of the object.
Identifiable.hashCode()
public void copy(ReflectorAssembly otherObject)
Deep copies the contents of the object from another object.
otherObject
- The object to be copied from.
public java.lang.Object clone()
Deep copies and returns a newly instantiated object.
clone
in interface Identifiable
clone
in class SFRAssembly
The newly instantiated copied object.
public void accept(ISFRComponentVisitor visitor)
accept
in class SFRAssembly
visitor
- An ISFRComponentVisitor that is visiting this SFRComponent.