Package com.twelvemonkeys.imageio.util
Class SequenceSupport
- java.lang.Object
-
- com.twelvemonkeys.imageio.util.SequenceSupport
-
public final class SequenceSupport extends java.lang.ObjectA tiny utility class that keeps state for sequences. For use byImageWriterimplementations that supports sequence (multiple images in same stream).- See Also:
ImageWriter.canWriteSequence()
-
-
Field Summary
Fields Modifier and Type Field Description private intindex
-
Constructor Summary
Constructors Constructor Description SequenceSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intadvance()Advances the current sequence.intcurrent()Gets the current sequence index.intend()Ends the current sequence.voidreset()Resets the sequence to initial state, regardless of the current sequence state.voidstart()Starts a new sequence.
-
-
-
Method Detail
-
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:
java.lang.IllegalStateException- if a sequence is already running.- See Also:
ImageWriter.prepareWriteSequence(IIOMetadata)
-
advance
public int advance()
Advances the current sequence.- Returns:
- the current sequence index.
- Throws:
java.lang.IllegalStateException- if a sequence is not running.- See Also:
ImageWriter.writeToSequence(IIOImage, ImageWriteParam)
-
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:
java.lang.IllegalStateException- if a sequence is not running.- See Also:
ImageWriter.endWriteSequence()
-
-