|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mavis.MeasurementSequence
public class MeasurementSequence
A list of measurement steps. Steps can be added or removed from the sequence.
All operations are thread-safe.
Field Summary | |
---|---|
private java.lang.String |
name
Name of the sequence. |
private java.util.List<MeasurementStep> |
steps
The measurement steps of this sequence. |
Constructor Summary | |
---|---|
MeasurementSequence()
Creates an empty sequence with no name. |
|
MeasurementSequence(org.w3c.dom.Element element)
Creates a sequence from the specified element. |
|
MeasurementSequence(org.w3c.dom.Element element,
Project project)
Creates a sequence from the specified element for a project. |
|
MeasurementSequence(java.lang.String name)
Creates an empty sequence with the specified name. |
Method Summary | |
---|---|
void |
addStep(int index,
MeasurementStep step)
Adds a step to the specified index of this sequence. |
void |
addStep(MeasurementStep step)
Appends a step to this sequence. |
int |
compareTo(MeasurementSequence other)
Orders the sequences by their name. |
org.w3c.dom.Element |
getElement(org.w3c.dom.Document document)
Exports this sequence to a DOM element. |
java.lang.String |
getName()
Returns the name of this sequence. |
MeasurementStep |
getStep(int index)
Returns the specified step from this sequence. |
int |
getStepIndex(MeasurementStep step)
Returns the index of the given MeasurementStep object in the sequence or -1 if it isn't in the
sequence. |
int |
getSteps()
Returns the number of steps in this sequence. |
void |
removeStep(int index)
Removes a step from this sequence. |
void |
setName(java.lang.String name)
Sets the name of this sequence. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.lang.String name
private final java.util.List<MeasurementStep> steps
Constructor Detail |
---|
public MeasurementSequence()
public MeasurementSequence(java.lang.String name)
name
- name of the sequence.
java.lang.NullPointerException
- if name is null.public MeasurementSequence(org.w3c.dom.Element element)
element
- the element from which this sequence will be created.
java.lang.NullPointerException
- if element is null.
java.lang.IllegalArgumentException
- if the element was not in the right format.public MeasurementSequence(org.w3c.dom.Element element, Project project)
element
- the element from which this sequence will be created.project
- the project whose sequence this will be, or null if this is not owned by a project. Needed for
importing the measurement steps correctly.
java.lang.NullPointerException
- if element is null.
java.lang.IllegalArgumentException
- if the element was not in the right format.Method Detail |
---|
public org.w3c.dom.Element getElement(org.w3c.dom.Document document)
document
- the document that will contain this element.public java.lang.String getName()
public void setName(java.lang.String name)
java.lang.NullPointerException
- if name is null.public int getSteps()
public MeasurementStep getStep(int index)
index
- the index of the step.
java.lang.IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= getSteps()).public void addStep(MeasurementStep step)
step
- the measurement step to be added.
java.lang.NullPointerException
- if step is null.public void addStep(int index, MeasurementStep step)
index
- the index to which the step will be added.step
- the measurement step to be added.
java.lang.IndexOutOfBoundsException
- if the index is out of range (index < 0 || index > getSteps()).
java.lang.NullPointerException
- if step is null.public void removeStep(int index)
index
- the index of the step to be removed.
java.lang.IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= getSteps()).public int compareTo(MeasurementSequence other)
compareTo
in interface java.lang.Comparable<MeasurementSequence>
other
- the sequence to be compared to.
public java.lang.String toString()
toString
in class java.lang.Object
public int getStepIndex(MeasurementStep step)
MeasurementStep
object in the sequence or -1 if it isn't in the
sequence.
step
- a MeasurementStep
object whose index we need.
MeasurementStep
or -1 if the step is not in the sequence.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |