Class SequenceSupport
java.lang.Object
com.twelvemonkeys.imageio.util.SequenceSupport
A tiny utility class that keeps state for sequences.
For use by
ImageWriter implementations that supports sequence (multiple images in same stream).- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
index
private int index
-
-
Constructor Details
-
SequenceSupport
public SequenceSupport()
-
-
Method Details
-
reset
public void reset()Resets the sequence to initial state, regardless of the current sequence state. -
start
public void start()Starts a new sequence.- Throws:
IllegalStateException- if a sequence is already running.- See Also:
-
advance
public int advance()Advances the current sequence.- Returns:
- the current sequence index.
- Throws:
IllegalStateException- if a sequence is not running.- See Also:
-
current
public int current()Gets the current sequence index.- Returns:
- the current sequence index, or
-1if a sequence is not running.
-
end
public int end()Ends the current sequence. The sequence is reset to initial state, and a new sequence may be started.- Returns:
- the current (last) sequence index
- Throws:
IllegalStateException- if a sequence is not running.- See Also:
-