Package org.scijava.io.handle
Class AbstractHigherOrderHandle<L extends Location>
- java.lang.Object
-
- org.scijava.AbstractContextual
-
- org.scijava.plugin.AbstractRichPlugin
-
- org.scijava.plugin.AbstractTypedPlugin<D>
-
- org.scijava.plugin.AbstractWrapperPlugin<L>
-
- org.scijava.io.handle.AbstractDataHandle<L>
-
- org.scijava.io.handle.AbstractHigherOrderHandle<L>
-
- All Implemented Interfaces:
Closeable,DataInput,DataOutput,AutoCloseable,Comparable<Prioritized>,Contextual,Identifiable,DataHandle<L>,Locatable,Logged,HasPluginInfo,RichPlugin,SciJavaPlugin,TypedPlugin<L>,WrapperPlugin<L>,Prioritized,Typed<L>,Versioned
- Direct Known Subclasses:
ReadBufferDataHandle,WriteBufferDataHandle
public abstract class AbstractHigherOrderHandle<L extends Location> extends AbstractDataHandle<L>
Abstract superclass forDataHandles that operate over otherDataHandles.- Author:
- Gabriel Einsdorf
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.scijava.io.handle.DataHandle
DataHandle.ByteOrder
-
-
Field Summary
-
Fields inherited from interface org.scijava.io.handle.DataHandle
DEFAULT_BLOCK_SIZE, MAX_SEARCH_SIZE
-
-
Constructor Summary
Constructors Constructor Description AbstractHigherOrderHandle(DataHandle<L> handle)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidcleanup()Clean up data structures after a handle has been closed in theclose()method.voidclose()protected voidensureOpen()booleanexists()Tests whether this handle's location actually exists at the source.Class<L>getType()Gets the type associated with the object.protected DataHandle<L>handle()booleanisReadable()Gets whether reading from this handle is supported.booleanisWritable()Gets whether writing to this handle is supported.longlength()Returns the length of the data in bytes.-
Methods inherited from class org.scijava.io.handle.AbstractDataHandle
conversionBuffer, getEncoding, getOrder, setEncoding, setOrder
-
Methods inherited from class org.scijava.plugin.AbstractWrapperPlugin
get, set
-
Methods inherited from class org.scijava.plugin.AbstractTypedPlugin
supports
-
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
getInfo, getPriority, setInfo, setPriority, toString
-
Methods inherited from class org.scijava.AbstractContextual
context, getContext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
-
Methods inherited from interface org.scijava.io.handle.DataHandle
available, checksum, ensureReadable, ensureWritable, findString, findString, findString, findString, isBigEndian, isLittleEndian, lastModified, offset, read, read, read, readBoolean, readChar, readCString, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readString, readString, readUnsignedByte, readUnsignedShort, readUTF, seek, setLength, setLittleEndian, skip, skipBytes, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLine, writeLong, writeShort, writeUTF
-
Methods inherited from interface java.io.DataOutput
write, write
-
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
-
Methods inherited from interface org.scijava.Locatable
getLocation
-
Methods inherited from interface org.scijava.Prioritized
compareTo, getPriority, setPriority
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
Methods inherited from interface org.scijava.plugin.WrapperPlugin
get, set
-
-
-
-
Constructor Detail
-
AbstractHigherOrderHandle
public AbstractHigherOrderHandle(DataHandle<L> handle)
-
-
Method Detail
-
isReadable
public boolean isReadable()
Description copied from interface:DataHandleGets whether reading from this handle is supported.
-
isWritable
public boolean isWritable()
Description copied from interface:DataHandleGets whether writing to this handle is supported.
-
length
public long length() throws IOExceptionDescription copied from interface:DataHandleReturns the length of the data in bytes.- Returns:
- The length, or -1 if the length is unknown.
- Throws:
IOException
-
getType
public Class<L> getType()
Description copied from interface:TypedGets the type associated with the object.
-
exists
public boolean exists() throws IOExceptionDescription copied from interface:DataHandleTests whether this handle's location actually exists at the source.- Returns:
- True if the location exists; false if not.
- Throws:
IOException- If something goes wrong with the existence check.
-
close
public void close() throws IOException- Throws:
IOException
-
ensureOpen
protected void ensureOpen() throws IOException- Throws:
IOException
-
cleanup
protected abstract void cleanup() throws IOExceptionClean up data structures after a handle has been closed in theclose()method.- Throws:
IOException
-
handle
protected DataHandle<L> handle()
- Returns:
- the
DataHandlewrapped by thisAbstractHigherOrderHandle
-
-