cc.mallet.pipe.iterator
Class UnlabeledFileIterator
- java.lang.Object
-
- cc.mallet.pipe.iterator.UnlabeledFileIterator
-
- All Implemented Interfaces:
- java.util.Iterator<Instance>
public class UnlabeledFileIterator extends java.lang.Object implements java.util.Iterator<Instance>
An iterator that generates instances from an initial directory or set of directories. The iterator will recurse through sub-directories. Each filename becomes the data field of an instance, and the targets are set to null. To set the target values to the directory name, use FileIterator instead.
-
-
Field Summary
Fields Modifier and Type Field and Description static java.util.regex.PatternALL_DIRECTORIESUse as label names all the directory names in the filename.static java.util.regex.PatternFIRST_DIRECTORYUse as label names the first directory in the filename.static java.util.regex.PatternLAST_DIRECTORYUse as label name the last directory in the filename.static java.util.regex.PatternSTARTING_DIRECTORIESUse as label names the directories specified in the constructor, optionally removing common prefix of all starting directories
-
Constructor Summary
Constructors Constructor and Description UnlabeledFileIterator(java.io.File directory)UnlabeledFileIterator(java.io.File[] directories)UnlabeledFileIterator(java.io.File directory, java.io.FileFilter fileFilter)UnlabeledFileIterator(java.lang.String directory)UnlabeledFileIterator(java.lang.String[] directories, java.io.FileFilter ff)UnlabeledFileIterator(java.lang.String directory, java.io.FileFilter filter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.util.ArrayList<java.io.File>getFileArray()booleanhasNext()Instancenext()java.io.FilenextFile()voidremove()static java.io.File[]stringArray2FileArray(java.lang.String[] sa)
-
-
-
Field Detail
-
STARTING_DIRECTORIES
public static final java.util.regex.Pattern STARTING_DIRECTORIES
Use as label names the directories specified in the constructor, optionally removing common prefix of all starting directories
-
FIRST_DIRECTORY
public static final java.util.regex.Pattern FIRST_DIRECTORY
Use as label names the first directory in the filename.
-
LAST_DIRECTORY
public static final java.util.regex.Pattern LAST_DIRECTORY
Use as label name the last directory in the filename.
-
ALL_DIRECTORIES
public static final java.util.regex.Pattern ALL_DIRECTORIES
Use as label names all the directory names in the filename.
-
-
Constructor Detail
-
UnlabeledFileIterator
public UnlabeledFileIterator(java.lang.String[] directories, java.io.FileFilter ff)
-
UnlabeledFileIterator
public UnlabeledFileIterator(java.io.File directory, java.io.FileFilter fileFilter)
-
UnlabeledFileIterator
public UnlabeledFileIterator(java.io.File directory)
-
UnlabeledFileIterator
public UnlabeledFileIterator(java.io.File[] directories)
-
UnlabeledFileIterator
public UnlabeledFileIterator(java.lang.String directory)
-
UnlabeledFileIterator
public UnlabeledFileIterator(java.lang.String directory, java.io.FileFilter filter)
-
-
Method Detail
-
getFileArray
public java.util.ArrayList<java.io.File> getFileArray()
-
stringArray2FileArray
public static java.io.File[] stringArray2FileArray(java.lang.String[] sa)
-
remove
public void remove()
- Specified by:
removein interfacejava.util.Iterator<Instance>
-
nextFile
public java.io.File nextFile()
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<Instance>
-
-
DataMelt 3.0 © DataMelt by jWork.ORG