|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--au.com.prunge.jgenfile.impl.AbstractFileAccessor
An abstract file accessor class to ease development of other file accessors.
Constructor Summary | |
AbstractFileAccessor()
Constructs an AbstractFileAccessor . |
Method Summary | |
protected void |
checkAcquired()
If channelAcquired is true, throws an exception. |
protected void |
checkClosed()
If accessorClosed is true, throws an exception. |
protected void |
checkGetChannel()
Calls btoh checkAcquired() and checkClosed(). |
boolean |
isAccessorClosed()
Returns whether this file accessor has been closed. |
boolean |
isChannelAcquired()
Returns whether a channel has been acquired from this accessor. |
protected void |
setAccessorClosed(boolean accessorClosed)
Sets the accessorClosed variable. |
protected void |
setChannelAcquired(boolean channelAcquired)
Sets the channelAcquired variable. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface au.com.prunge.jgenfile.FileAccessor |
createCloseOperation, getRandomAccessReadChannel, getRandomAccessReadWriteChannel, getRandomAccessWriteChannel, getReadChannel, getReadWriteChannel, getWriteChannel |
Constructor Detail |
public AbstractFileAccessor()
AbstractFileAccessor
.
Method Detail |
public boolean isChannelAcquired()
FileAccessor
isChannelAcquired
in interface FileAccessor
FileAccessor.isChannelAcquired()
public boolean isAccessorClosed()
FileAccessor
isAccessorClosed
in interface FileAccessor
FileAccessor.isAccessorClosed()
protected void setAccessorClosed(boolean accessorClosed)
accessorClosed
- true to throw an exception on
the next checkClosed() call, false otherwise.protected void setChannelAcquired(boolean channelAcquired)
channelAcquired
- true to throw an exception on
the next checkAcquried() call, false otherwise.protected void checkClosed() throws FileAccessorClosedException
FileAccessorClosedException
- if accessorClosed
is true.setAccessorClosed(boolean)
protected void checkAcquired() throws ChannelAcquiredException
ChannelAcquiredException
- if channelAcquired
is true.AbstractFileAccessor#setChannelAcquried
protected void checkGetChannel() throws FileAccessorClosedException, ChannelAcquiredException
Subclasses may call this method to verify that a channel has not already been acquired and that the file accessor is not closed.
FileAccessorClosedException
- if accessorClosed is true.
ChannelAcquiredException
- if channelAcquired is true.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |