public class Memoizer extends ReaderWrapper
ReaderWrapper implementation which caches the state of the
delegate (including and other ReaderWrapper instances)
after setId has been called.| Modifier and Type | Class and Description |
|---|---|
static interface |
Memoizer.Deser |
static class |
Memoizer.KryoDeser |
| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_MINIMUM_ELAPSED
Default value for
minimumElapsed if none is provided in the
constructor. |
protected Memoizer.Deser |
ser |
static java.lang.Integer |
VERSION
Defines the file format.
|
readerCAN_GROUP, CANNOT_GROUP, MUST_GROUP| Constructor and Description |
|---|
Memoizer()
Constructs a memoizer around a new image reader.
|
Memoizer(IFormatReader r)
Constructs a memoizer around the given reader.
|
Memoizer(IFormatReader r,
long minimumElapsed)
Constructs a memoizer around the given reader.
|
Memoizer(IFormatReader r,
long minimumElapsed,
java.io.File directory) |
Memoizer(long minimumElapsed)
Constructs a memoizer around a new image reader.
|
Memoizer(long minimumElapsed,
java.io.File directory) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cleanup() |
void |
close() |
void |
close(boolean fileOnly)
Closes the currently open file.
|
protected Memoizer.Deser |
getDeser()
Returns a configured
Kryo instance. |
java.io.File |
getMemoFile(java.lang.String id)
Constructs a
File object from setId string. |
MetadataStore |
getMetadataStore()
Retrieves the current metadata store for this reader.
|
protected OMEXMLService |
getService() |
protected IFormatReader |
handleMetadataStore(IFormatReader memo)
Return the
IFormatReader instance that is passed in or null if
it has been invalidated, which will include the instance being closed. |
boolean |
isLoadedFromMemo() |
boolean |
isSavedToMemo() |
boolean |
isVersionChecking()
Returns whether or not version checking is done based upon major/minor
version numbers.
|
IFormatReader |
loadMemo() |
static void |
main(java.lang.String[] args) |
boolean |
saveMemo() |
void |
setId(java.lang.String id)
Sets the current file name.
|
void |
setMetadataStore(MetadataStore store)
Sets the default metadata store for this reader.
|
void |
setVersionChecking(boolean version)
Set whether version checking is done based upon major/minor version
numbers.
|
protected org.perf4j.slf4j.Slf4JStopWatch |
stopWatch() |
boolean |
versionMismatch()
Returns true if the version of the memo file as returned by
Memoizer.Deser.loadReleaseVersion() and Memoizer.Deser.loadRevision()
do not match the current version as specified by FormatTools.VERSION
and FormatTools.VCS_REVISION, respectively. |
coreIndexToSeries, duplicate, fileGroupOption, get16BitLookupTable, get8BitLookupTable, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getBitsPerPixel, getChannelDimLengths, getChannelDimTypes, getCoreIndex, getCoreMetadata, getCoreMetadataList, getCurrentFile, getDatasetStructureDescription, getDimensionOrder, getDomains, getEffectiveSizeC, getFormat, getGlobalMetadata, getImageCount, getIndex, getMetadataOptions, getMetadataStoreRoot, getMetadataValue, getModuloC, getModuloT, getModuloZ, getNativeDataType, getOptimalTileHeight, getOptimalTileWidth, getPixelType, getPossibleDomains, getReader, getRequiredDirectories, getResolution, getResolutionCount, getRGBChannelCount, getSeries, getSeriesCount, getSeriesMetadata, getSeriesMetadataValue, getSeriesUsedFiles, getSeriesUsedFiles, getSizeC, getSizeT, getSizeX, getSizeY, getSizeZ, getSuffixes, getSupportedMetadataLevels, getThumbSizeX, getThumbSizeY, getUnderlyingReaders, getUsedFiles, getUsedFiles, getZCTCoords, hasCompanionFiles, hasFlattenedResolutions, isFalseColor, isGroupFiles, isIndexed, isInterleaved, isInterleaved, isLittleEndian, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOriginalMetadataPopulated, isRGB, isSingleFile, isThisType, isThisType, isThisType, isThisType, isThumbnailSeries, openBytes, openBytes, openBytes, openBytes, openPlane, openThumbBytes, seriesToCoreIndex, setCoreIndex, setFlattenedResolutions, setGroupFiles, setMetadataFiltered, setMetadataOptions, setNormalized, setOriginalMetadataPopulated, setResolution, setSeries, unwrap, unwrap, unwrappublic static final java.lang.Integer VERSION
public static final long DEFAULT_MINIMUM_ELAPSED
minimumElapsed if none is provided in the
constructor.protected transient Memoizer.Deser ser
public Memoizer()
public Memoizer(long minimumElapsed)
public Memoizer(long minimumElapsed,
java.io.File directory)
public Memoizer(IFormatReader r)
public Memoizer(IFormatReader r, long minimumElapsed)
public Memoizer(IFormatReader r, long minimumElapsed, java.io.File directory)
public boolean isLoadedFromMemo()
public boolean isSavedToMemo()
public boolean isVersionChecking()
public boolean versionMismatch()
throws java.io.IOException
Memoizer.Deser.loadReleaseVersion() and Memoizer.Deser.loadRevision()
do not match the current version as specified by FormatTools.VERSION
and FormatTools.VCS_REVISION, respectively.java.io.IOExceptionpublic void setVersionChecking(boolean version)
protected void cleanup()
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class ReaderWrapperjava.io.IOExceptionpublic void close(boolean fileOnly)
throws java.io.IOException
IFormatReaderCloseable.close().close in interface IFormatReaderclose in class ReaderWrapperjava.io.IOExceptionpublic void setId(java.lang.String id)
throws FormatException,
java.io.IOException
IFormatHandlersetId in interface IFormatHandlersetId in class ReaderWrapperFormatExceptionjava.io.IOExceptionpublic void setMetadataStore(MetadataStore store)
IFormatReadersetMetadataStore in interface IFormatReadersetMetadataStore in class ReaderWrapperstore - a metadata store implementation.public MetadataStore getMetadataStore()
IFormatReadernull
metadata store.getMetadataStore in interface IFormatReadergetMetadataStore in class ReaderWrapperprotected Memoizer.Deser getDeser()
Kryo instance. This method can be modified
by consumers. The returned instance is not thread-safe.Kryo instance.protected OMEXMLService getService() throws MissingLibraryException
MissingLibraryExceptionprotected org.perf4j.slf4j.Slf4JStopWatch stopWatch()
public java.io.File getMemoFile(java.lang.String id)
File object from setId string. This method can be
modified by consumers, but then existing memo files will not be found.id - the path passed to setIdpublic IFormatReader loadMemo() throws java.io.IOException, FormatException
java.io.IOExceptionFormatExceptionpublic boolean saveMemo()
protected IFormatReader handleMetadataStore(IFormatReader memo) throws MissingLibraryException
IFormatReader instance that is passed in or null if
it has been invalidated, which will include the instance being closed.
MetadataStore
implementation is passed in when no memo file exists, then a replacement
MetadataStore will be created and set on the ReaderWrapper.reader
delegate before calling ReaderWrapper.setId(String). This stack
will then be serialized, before any values are copied into
userMetadataStore.
MetadataStore
implementation is set before calling setId(String) then ...
MissingLibraryExceptionpublic static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.ExceptionCopyright © 2014 Open Microscopy Environment