fi.helsinki.dacopan.model
Interface StepIterator

All Known Implementing Classes:
ScenarioStepIterator

public interface StepIterator

An iterator for stepping thru an animation sequence.

Version:
$Id: StepIterator.java,v 1.2 2004/04/26 17:57:19 vainio Exp $
See Also:
DataView.getStepIterator(Layer)

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.
 

Method Detail

hasNext

boolean hasNext()
Returns true if the iterator can step forward.


hasPrevious

boolean hasPrevious()
Returns true if the iterator can step back.


next

float next()
Steps forward.

Throws:
java.lang.IllegalStateException - if at end

previous

float previous()
Steps back.

Throws:
java.lang.IllegalStateException - if at beginning

first

float first()
Steps to beginning of the sequence.


last

float last()
Steps to end of the sequence.


current

float current()
Returns the current step.


getNextForTime

float getNextForTime(float time)
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.

Returns:
The new iterator value.

getPreviousForTime

float getPreviousForTime(float time)
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.

Returns:
The new iterator value.


© Dacopan2 team, 2005-