au.com.prunge.jgenfile.impl.local
Class LocalCanGetChildOperation
java.lang.Object
|
+--au.com.prunge.jgenfile.impl.AbstractOperation
|
+--au.com.prunge.jgenfile.impl.AbstractItemOperation
|
+--au.com.prunge.jgenfile.impl.AbstractDirectoryOperation
|
+--au.com.prunge.jgenfile.impl.local.LocalCanGetChildOperation
- All Implemented Interfaces:
- CanGetChildOperation, DirectoryOperation, ItemOperation, Operation
- public class LocalCanGetChildOperation
- extends AbstractDirectoryOperation
- implements CanGetChildOperation
A local implementation of the can get child operation.
- Version:
- 1.0
- Author:
- Peter Runge
Method Summary |
boolean |
canGetChild()
Returns whether the child of the directory can be acquired. |
String |
getItemName()
Returns the name of the item to find. |
void |
runImpl()
The actual run() implementation goes in this method. |
Methods inherited from class au.com.prunge.jgenfile.impl.AbstractOperation |
abort, addOperationHints, checkRun, getLastRunException, getOperationHint, getOperationHints, hasRun, run, setLastRunException, setOperationHint, setOperationHints |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LocalCanGetChildOperation
public LocalCanGetChildOperation(LocalDirectory directory,
String itemName)
throws NullPointerException
- Constructs a
LocalCanGetChildOperation
.
- Parameters:
directory
- the directory the operation is for.itemName
- the name of the item to search for.
canGetChild
public boolean canGetChild()
throws OperationNotFinishedException,
JGenFileException
- Description copied from interface:
CanGetChildOperation
- Returns whether the child of the directory can be acquired.
- Specified by:
canGetChild
in interface CanGetChildOperation
- Returns:
- true if the child can be acquired, false if not.
- Throws:
OperationNotFinishedException
- if this method
was called and the run() method has not
finished or has not been called.
JGenFileException
- if another error occurs.- See Also:
CanGetChildOperation.canGetChild()
getItemName
public String getItemName()
- Description copied from interface:
CanGetChildOperation
- Returns the name of the item to find.
- Specified by:
getItemName
in interface CanGetChildOperation
- Returns:
- the name of the item to find.
- See Also:
CanGetChildOperation.getItemName()
runImpl
public void runImpl()
throws JGenFileException
- Description copied from class:
AbstractOperation
- The actual run() implementation goes in this method.
Setting the last run exception and setting hasRun to
true is not required by this method as it is handled
by the run() method in this class.
If this method completes successfully (i.e. without
throwing an exception), the last run exception is
set to null indicating no exception occurred and
subsequent calls to hasRun() will return true.
If this method throws an exception, the last run exception
is filled in and hasRun() subsequent calls to hasRun()
will return false.
- Specified by:
runImpl
in class AbstractOperation
- Throws:
JGenFileException
- if an error occurs.- See Also:
au.com.prunge.jgenfile.AbstractOperation#runImpl()