fi.helsinki.dacopan.model
Class ScenarioStepIterator

java.lang.Object
  extended by fi.helsinki.dacopan.model.ScenarioStepIterator
All Implemented Interfaces:
StepIterator

public class ScenarioStepIterator
extends java.lang.Object
implements StepIterator

A StepIterator for stepping thru a whole scenario, including both protocol events and notes.

Version:
$Id: ScenarioStepIterator.java,v 1.6 2004/05/27 07:27:10 jaarnial Exp $

Constructor Summary
ScenarioStepIterator(Layer layer, DataView view, NoteManager noteManager)
          Creates the iterator for stepping thru the specified layer with the given events and notes.
 
Method Summary
 float current()
          Returns the current step.
 float first()
          Steps to beginning of the sequence.
 float getNextForTime(float time)
          Sets the iterator to the nearest time that is after the time given as parameter.
 float getPreviousForTime(float time)
          Sets the iterator to the nearest time that is before the time given as parameter.
 boolean hasNext()
          Returns true if the iterator can step forward.
 boolean hasPrevious()
          Returns true if the iterator can step back.
 float last()
          Steps to end of the sequence.
 float next()
          Steps forward.
 float previous()
          Steps back.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScenarioStepIterator

public ScenarioStepIterator(Layer layer,
                            DataView view,
                            NoteManager noteManager)
Creates the iterator for stepping thru the specified layer with the given events and notes.

Method Detail

hasNext

public boolean hasNext()
Description copied from interface: StepIterator
Returns true if the iterator can step forward.

Specified by:
hasNext in interface StepIterator

hasPrevious

public boolean hasPrevious()
Description copied from interface: StepIterator
Returns true if the iterator can step back.

Specified by:
hasPrevious in interface StepIterator

next

public float next()
Description copied from interface: StepIterator
Steps forward.

Specified by:
next in interface StepIterator

previous

public float previous()
Description copied from interface: StepIterator
Steps back.

Specified by:
previous in interface StepIterator

first

public float first()
Description copied from interface: StepIterator
Steps to beginning of the sequence.

Specified by:
first in interface StepIterator

last

public float last()
Description copied from interface: StepIterator
Steps to end of the sequence.

Specified by:
last in interface StepIterator

current

public float current()
Description copied from interface: StepIterator
Returns the current step.

Specified by:
current in interface StepIterator

getNextForTime

public float getNextForTime(float time)
Description copied from interface: StepIterator
Sets the iterator to the nearest time that is after the time given as parameter. If given time is after the last possible step, the iterator is set to the last step.

Specified by:
getNextForTime in interface StepIterator
Returns:
The new iterator value.

getPreviousForTime

public float getPreviousForTime(float time)
Description copied from interface: StepIterator
Sets the iterator to the nearest time that is before the time given as parameter. If given time is before the first possible step, the iterator is set to the first step.

Specified by:
getPreviousForTime in interface StepIterator
Returns:
The new iterator value.


© Dacopan2 team, 2005-