Package digilib.io
Class ImageFileSet
- java.lang.Object
-
- digilib.io.ImageSet
-
- digilib.io.ImageFileSet
-
- All Implemented Interfaces:
DocuDirent
,Comparable<Object>
public class ImageFileSet extends ImageSet implements DocuDirent
ImageSet using ImageFiles filled from an array of scaled Directories.- Author:
- casties
-
-
Field Summary
Fields Modifier and Type Field Description protected File
file
the (main) fileprotected static FileOps.FileClass
fileClass
this is an image fileprotected FileMeta
meta
the FileMeta instanceprotected boolean
metaChecked
is our metadata validprotected String
name
the file nameprotected DocuDirectory
parent
the parent DocuDirectory
-
Constructor Summary
Constructors Constructor Description ImageFileSet(File file, FsDirectory[] scaleDirs)
Constructor with a File and Directories.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkMeta()
Checks metadata and sets resolution in resX and resY.int
compareTo(Object arg0)
Comparator using the file name.protected void
fill(FsDirectory[] scaleDirs, File fl)
Fill the ImageSet with files from an array of base directories.File
getFile()
Get the default File.FileMeta
getMeta()
Returns the meta-data for this file(set).String
getName()
The name of the file.DocuDirectory
getParent()
Returns the parent Directory.boolean
isMetaChecked()
void
readMeta()
Reads meta-data for this Fileset if there is any.void
setMeta(FileMeta fileMeta)
Sets the meta-data for this file(set).void
setParent(DocuDirectory parent)
Sets the parent Directory.-
Methods inherited from class digilib.io.ImageSet
add, append, get, get, getAspect, getBiggest, getBiggestPreferred, getHiresIterator, getLoresIterator, getNextBigger, getNextBigger, getNextBiggerPreferred, getNextSmaller, getNextSmaller, getNextSmallerPreferred, getResX, getResY, getSmallest, getSmallestPreferred, setAspect, size
-
-
-
-
Field Detail
-
fileClass
protected static FileOps.FileClass fileClass
this is an image file
-
file
protected File file
the (main) file
-
name
protected String name
the file name
-
meta
protected FileMeta meta
the FileMeta instance
-
metaChecked
protected boolean metaChecked
is our metadata valid
-
parent
protected DocuDirectory parent
the parent DocuDirectory
-
-
Constructor Detail
-
ImageFileSet
public ImageFileSet(File file, FsDirectory[] scaleDirs)
Constructor with a File and Directories.- Parameters:
file
- the FilescaleDirs
- the Directories
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:DocuDirent
The name of the file. If this is a Fileset, the method returns the name of the default file (for image filesets the highest resolution file).- Specified by:
getName
in interfaceDocuDirent
- Returns:
- the name
-
getParent
public DocuDirectory getParent()
Description copied from interface:DocuDirent
Returns the parent Directory.- Specified by:
getParent
in interfaceDocuDirent
- Returns:
- the DocuDirectory
-
setParent
public void setParent(DocuDirectory parent)
Description copied from interface:DocuDirent
Sets the parent Directory.- Specified by:
setParent
in interfaceDocuDirent
- Parameters:
parent
- The parent to set
-
isMetaChecked
public boolean isMetaChecked()
-
compareTo
public int compareTo(Object arg0)
Description copied from interface:DocuDirent
Comparator using the file name. Compares to a String (for binarySearch) or to another DocuDirent (for sort).- Specified by:
compareTo
in interfaceComparable<Object>
- Specified by:
compareTo
in interfaceDocuDirent
- Parameters:
arg0
- the other Object- See Also:
Comparable.compareTo(java.lang.Object)
-
getFile
public File getFile()
Get the default File.- Returns:
- the File
-
fill
protected void fill(FsDirectory[] scaleDirs, File fl)
Fill the ImageSet with files from an array of base directories.- Parameters:
scaleDirs
- array of base directoriesfl
- file (from first base dir)
-
checkMeta
public void checkMeta()
Checks metadata and sets resolution in resX and resY.- Specified by:
checkMeta
in interfaceDocuDirent
- Overrides:
checkMeta
in classImageSet
-
readMeta
public void readMeta()
Description copied from interface:DocuDirent
Reads meta-data for this Fileset if there is any.- Specified by:
readMeta
in interfaceDocuDirent
-
getMeta
public FileMeta getMeta()
Description copied from interface:DocuDirent
Returns the meta-data for this file(set).- Specified by:
getMeta
in interfaceDocuDirent
- Returns:
- the FileMeta
-
setMeta
public void setMeta(FileMeta fileMeta)
Description copied from interface:DocuDirent
Sets the meta-data for this file(set).- Specified by:
setMeta
in interfaceDocuDirent
- Parameters:
fileMeta
- The fileMeta to set
-
-