|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectikayaki.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 String |
name
Name of the sequence. |
private List<MeasurementStep> |
steps
The measurement steps of this sequence. |
Constructor Summary | |
---|---|
MeasurementSequence()
Creates an empty sequence with no name. |
|
MeasurementSequence(Element element)
Creates a sequence from the specified element. |
|
MeasurementSequence(Element element,
Project project)
Creates a sequence from the specified element for a project. |
|
MeasurementSequence(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. |
Element |
getElement(Document document)
Exports this sequence to a DOM element. |
String |
getName()
Returns the name of this sequence. |
MeasurementStep |
getStep(int index)
Returns the specified step from this sequence. |
int |
getSteps()
Returns the number of steps in this sequence. |
void |
removeStep(int index)
Removes a step from this sequence. |
void |
setName(String name)
Sets the name of this sequence. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private String name
private final List<MeasurementStep> steps
Constructor Detail |
---|
public MeasurementSequence()
public MeasurementSequence(String name)
name
- name of the sequence.
NullPointerException
- if name is null.public MeasurementSequence(Element element)
element
- the element from which this sequence will be created.
NullPointerException
- if element is null.
IllegalArgumentException
- if the element was not in the right format.public MeasurementSequence(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.
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 String getName()
public void setName(String name)
NullPointerException
- if name is null.public int getSteps()
public MeasurementStep getStep(int index)
index
- the index of the step.
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= getSteps()).public void addStep(MeasurementStep step)
step
- the measurement step to be added.
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.
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index > getSteps()).
NullPointerException
- if step is null.public void removeStep(int index)
index
- the index of the step to be removed.
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= getSteps()).public int compareTo(MeasurementSequence other)
compareTo
in interface Comparable<MeasurementSequence>
other
- the sequence to be compared to.
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |