mavis
Class MagneticComponents

java.lang.Object
  extended by mavis.MagneticComponents

public class MagneticComponents
extends java.lang.Object

This class is used to store the steps of magnetic components and the antipole values and to retrieve these steps and values. Components are accessed through their index, which starts from 0.


Field Summary
private  java.util.Vector<java.lang.Boolean> componentIsAntipole
           
private  Session session
           
private  java.util.Vector<int[]> stepNumbers
           
private  java.util.Vector<java.util.Vector<MeasurementStep>> steps
           
 
Constructor Summary
MagneticComponents(Session session)
           
 
Method Summary
 boolean addComponent(java.util.Vector<MeasurementStep> steps)
          Adds a new collection of MeasurementSteps.
 boolean addStepNumbers(int[] stepnumbers)
          Call to add the component's step indices to those as in the measurement sequence table
 java.lang.Boolean getAntipole(int component)
          Check if the specified component is an antipole or not.
 int getNumOfComponents()
          Return the number of magnetic components currently present.
 int[] getStepNumbers(int component)
          Returns an int[] of the component's step indices in the measurement sequence table
 java.util.Vector<MeasurementStep> getSteps(int component)
          Returns the collection of MeasurementSteps associated with the specified magnetic component.
 boolean removeComponent(int component)
          Removes one component i.e. collection of MeasurementSteps.
 void setAntipole(int component, boolean isAntipole)
          Sets the specified component to be antipole or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

session

private Session session

steps

private java.util.Vector<java.util.Vector<MeasurementStep>> steps

stepNumbers

private java.util.Vector<int[]> stepNumbers

componentIsAntipole

private java.util.Vector<java.lang.Boolean> componentIsAntipole
Constructor Detail

MagneticComponents

public MagneticComponents(Session session)
Method Detail

addComponent

public boolean addComponent(java.util.Vector<MeasurementStep> steps)
Adds a new collection of MeasurementSteps.

Parameters:
steps - A vector that contains the MeasurementSteps that should be considered as part of the added magnetic component.
Returns:
true if successful

addStepNumbers

public boolean addStepNumbers(int[] stepnumbers)
Call to add the component's step indices to those as in the measurement sequence table

Parameters:
stepnumbers - An int[] that contains the indices to add to the most recent component. Indices are the same as those in the measurement sequence table
Returns:
true if successful

removeComponent

public boolean removeComponent(int component)
Removes one component i.e. collection of MeasurementSteps. At the same time, it also removes the associated step numbers.

Parameters:
component - Which magnetic component to remove (0 is the first).
Returns:
true if successful

getSteps

public java.util.Vector<MeasurementStep> getSteps(int component)
Returns the collection of MeasurementSteps associated with the specified magnetic component.

Parameters:
component - Which magnetic component (0 is the first).
Returns:
null if fails

getStepNumbers

public int[] getStepNumbers(int component)
Returns an int[] of the component's step indices in the measurement sequence table

Parameters:
component - Which magnetic component (0 is the first)
Returns:
an int[] with the step indices, indices are the same as in the measurement sequence table

getNumOfComponents

public int getNumOfComponents()
Return the number of magnetic components currently present. This is actually the count of measurementstep collections. (Note: this may or may not be the same as the number of added step number collections or the size of the Antipole boolean array.)


setAntipole

public void setAntipole(int component,
                        boolean isAntipole)
Sets the specified component to be antipole or not. Antipole means that the direction of the component vector is reversed.

Parameters:
component - which component
isAntipole - true if the component should be an antipole

getAntipole

public java.lang.Boolean getAntipole(int component)
Check if the specified component is an antipole or not.

Parameters:
component - which component
Returns:
true if the component is an antipole