|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectikayaki.MeasurementStep
public class MeasurementStep
A single step in a measurement sequence. Each step can include multiple measurements for improved precision. A step can have a different volume and mass than the related project, but by default the volume and mass of the project will be used. Any changes made to the measurement step will invoke the project's autosaving. Only the project may change the state and results of a measurement step.
All operations are thread-safe.
Nested Class Summary | |
---|---|
static class |
MeasurementStep.State
The state of a measurement step. |
Field Summary | |
---|---|
private double |
mass
The mass of this step's sample, or a negative number to use the project's default mass. |
private Project |
project
The project that owns this step, or null if there is no owner. |
private List<MeasurementResult> |
results
The individual measurement results that are part of this measurement step. |
private MeasurementStep.State |
state
Tells if this step has been completed or not, or if a measurement is still running. |
private double |
stepValue
The AF or Thermal value of this step, or a negative number if it has not been specified. |
private double |
susceptibility
The susceptibility of this step's sample, or a negative number to use the project's default volume. |
private Date |
timestamp
The time the measurements were completed, or null if that has not yet happened. |
private double |
volume
The volume of this step's sample, or a negative number to use the project's default volume. |
Constructor Summary | |
---|---|
MeasurementStep()
Creates a blank measurement step. |
|
MeasurementStep(Element element)
Creates a measurement step from the specified element. |
|
MeasurementStep(Element element,
Project project)
Creates a measurement step from the specified element for a project. |
|
MeasurementStep(Project project)
Creates a blank measurement step for a project. |
Method Summary | |
---|---|
void |
addResult(MeasurementResult result)
Appends a measurement result to this step. |
Element |
getElement(Document document)
Exports this step to a DOM element. |
javax.vecmath.Vector3d |
getHolder()
Returns the average of the holder results (raw values). |
double |
getMass()
Returns the mass of this step's sample, or a negative number to use the project's default mass. |
javax.vecmath.Vector3d |
getNoise()
Returns the average of the noise results (raw values). |
Project |
getProject()
Returns the owner project of this step, or null if there is no owner. |
MeasurementResult |
getResult(int index)
Returns the specified result from this step. |
int |
getResults()
Returns the number of results in this step. |
MeasurementStep.State |
getState()
Tells if this step has been completed or not, or if a measurement is still running. |
double |
getStepValue()
Returns the AF/Thermal value of this step, or a negative number if it has not been specified. |
double |
getSusceptibility()
Returns the susceptibility of this step's sample, or a negative number to use the project's default susceptibility. |
Date |
getTimestamp()
Returns the time the measurements were completed, or null if that has not yet happened. |
double |
getVolume()
Returns the volume of this step's sample, or a negative number to use the project's default volume. |
Iterator<MeasurementResult> |
iterator()
Returns an iterator for iterating through this step's measurement results. |
void |
save()
Invokes the owner project's autosaving. |
void |
setDone()
Called after all results have been added. |
void |
setMass(double mass)
Sets the mass of this step's sample. |
void |
setMeasuring()
Called when the step's measurements are started. |
void |
setStepValue(double stepValue)
Sets the value of this step. |
void |
setSusceptibility(double susceptibility)
Sets the susceptibility of this step's sample. |
void |
setVolume(double volume)
Sets the volume of this step's sample. |
protected void |
updateTransforms()
Updates all of the measurement results with the owner project's transformation matrix and applies the noise and holder fixes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final Project project
private MeasurementStep.State state
private Date timestamp
private double stepValue
private double mass
private double volume
private double susceptibility
private final List<MeasurementResult> results
Constructor Detail |
---|
public MeasurementStep()
public MeasurementStep(Project project)
project
- the project who is the owner of this step.public MeasurementStep(Element element)
element
- the element from which this step will be created.
NullPointerException
- if element is null.
IllegalArgumentException
- if the element was not in the right format.public MeasurementStep(Element element, Project project)
element
- the element from which this step will be created.project
- the project who is the owner of this step.
NullPointerException
- if element is null.
IllegalArgumentException
- if the element was not in the right format.Method Detail |
---|
public Element getElement(Document document)
document
- the document that will contain this element.public void save()
public Project getProject()
public MeasurementStep.State getState()
public Date getTimestamp()
public double getStepValue()
public void setStepValue(double stepValue)
IllegalStateException
- if the step's state is not READY.public double getMass()
public void setMass(double mass)
public double getVolume()
public void setVolume(double volume)
public double getSusceptibility()
public void setSusceptibility(double susceptibility)
protected void updateTransforms()
public int getResults()
public MeasurementResult getResult(int index)
index
- the index of the result.
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= getResults()).public void addResult(MeasurementResult result)
result
- the result to be added.
NullPointerException
- if result is null.
IllegalStateException
- if this step's state is not READY or MEASURING.public void setMeasuring()
IllegalStateException
- if this method is called when the state is marked as DONE.public void setDone()
public javax.vecmath.Vector3d getHolder()
public javax.vecmath.Vector3d getNoise()
public Iterator<MeasurementResult> iterator()
iterator
in interface Iterable<MeasurementResult>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |