Package toxi.util
Class FileSequenceDescriptor
java.lang.Object
toxi.util.FileSequenceDescriptor
A descriptor and iterator for handling file sequences.
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionFileSequenceDescriptor(String filePattern, String extension, int numDigits, int start) Creates a new descriptor from the given sequence details.
- 
Method SummaryModifier and TypeMethodDescriptionReturns the base path of the sequence, i.e.intCalculates sequence durationintIdentifies the index of the last file of the sequence.getPathForIndex(int i) Constructs the file path for the given absolute indexintReturns the index of the first file of the sequence.iterator()Creates an iterator providing paths for each file in the sequence.Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Field Details- 
filePattern
- 
extension
- 
numDigitspublic int numDigits
- 
startpublic int start
- 
endpublic int end
 
- 
- 
Constructor Details- 
FileSequenceDescriptorCreates a new descriptor from the given sequence details.- Parameters:
- filePattern- file pattern in the format: e.g. "path/basename%d04.ext"
- extension- file extension (e.g. ".tga")
- numDigits- number of digits used for the index
- start- start index
 
 
- 
- 
Method Details- 
getBasePathReturns the base path of the sequence, i.e. the substring of the sequence's file pattern from the beginning until the first occurence of the % sign indicating the frame numbers.- Returns:
- path string
 
- 
getDurationpublic int getDuration()Calculates sequence duration- Returns:
- number of files in sequence
 
- 
getFinalIndexpublic int getFinalIndex()Identifies the index of the last file of the sequence.- Returns:
- final index
 
- 
getPathForIndexConstructs the file path for the given absolute index- Parameters:
- i- index
- Returns:
- path
 
- 
getStartIndexpublic int getStartIndex()Returns the index of the first file of the sequence.- Returns:
- start index
 
- 
iteratorCreates an iterator providing paths for each file in the sequence. The iterator does not support the remove() method and attempts to use it results in anUnsupportedOperationExceptionbeing thrown.
 
-