Package digilib.io
Class ImageFileSet
java.lang.Object
digilib.io.ImageSet
digilib.io.ImageFileSet
- All Implemented Interfaces:
DocuDirent
,Comparable<Object>
ImageSet using ImageFiles filled from an array of scaled Directories.
- Author:
- casties
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected File
the (main) fileprotected static FileOps.FileClass
this is an image fileprotected FileMeta
the FileMeta instanceprotected boolean
is our metadata validprotected String
the file nameprotected DocuDirectory
the parent DocuDirectory -
Constructor Summary
ConstructorsConstructorDescriptionImageFileSet
(File file, FsDirectory[] scaleDirs) Constructor with a File and Directories. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks metadata and sets resolution in resX and resY.int
Comparator using the file name.protected void
fill
(FsDirectory[] scaleDirs, File fl) Fill the ImageSet with files from an array of base directories.getFile()
Get the default File.getMeta()
Returns the meta-data for this file(set).getName()
The name of the file.Returns the parent Directory.boolean
void
readMeta()
Reads meta-data for this Fileset if there is any.void
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 Details
-
fileClass
this is an image file -
file
the (main) file -
name
the file name -
meta
the FileMeta instance -
metaChecked
protected boolean metaCheckedis our metadata valid -
parent
the parent DocuDirectory
-
-
Constructor Details
-
ImageFileSet
Constructor with a File and Directories.- Parameters:
file
- the FilescaleDirs
- the Directories
-
-
Method Details
-
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
Description copied from interface:DocuDirent
Returns the parent Directory.- Specified by:
getParent
in interfaceDocuDirent
- Returns:
- the DocuDirectory
-
setParent
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
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:
-
getFile
Get the default File.- Returns:
- the File
-
fill
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
Description copied from interface:DocuDirent
Returns the meta-data for this file(set).- Specified by:
getMeta
in interfaceDocuDirent
- Returns:
- the FileMeta
-
setMeta
Description copied from interface:DocuDirent
Sets the meta-data for this file(set).- Specified by:
setMeta
in interfaceDocuDirent
- Parameters:
fileMeta
- The fileMeta to set
-