org.keridwen.core.data.model.io.impl
Class DefaultTreeReader

java.lang.Object
  extended by org.keridwen.core.data.model.io.impl.DefaultTreeReader
All Implemented Interfaces:
TreeReader, Controllable, Progressable

public class DefaultTreeReader
extends Object
implements TreeReader


Constructor Summary
DefaultTreeReader()
           
 
Method Summary
 void addControllableListener(ControllableListener listener)
          Adds a ControllableListener.
 void addProgressableListener(ProgressableListener listener)
          Adds a ProgressableListener.
 void clearControllableListener()
          Clears the list of listeners.
 void clearProgressableListener()
          Clears the list of listeners.
 int getProgress()
          Gets the current progress of the Progressable.
 ControllableState getState()
          Gets the controllable state.
 void interrupt()
          Sends to the command the order to interrupt its current tasks as soon as possible.
 boolean isDetermined()
          Checks whether the progress is determined.
 boolean isInterrupted()
          Checks whether this Controllable has been interrupted.
 boolean isInterruptible()
          Checks whether this Controllable can be interrupted.
 boolean isPausable()
          Checks whether this Controllable can be paused.
 void pause()
          Pauses this Command.
 void readTree(DataModel modelToInitialize, URI anURI, String metadataFileName)
           
 void removeControllableListener(ControllableListener listener)
          Removes a ControllableListener.
 void removeProgressableListener(ProgressableListener listener)
          Removes a ProgressableListener.
 void resume()
          Resumes a paused Command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTreeReader

public DefaultTreeReader()
Method Detail

readTree

public void readTree(DataModel modelToInitialize,
                     URI anURI,
                     String metadataFileName)
              throws IOException
Specified by:
readTree in interface TreeReader
Throws:
IOException

getProgress

public int getProgress()
Description copied from interface: Progressable
Gets the current progress of the Progressable.

Specified by:
getProgress in interface Progressable
Returns:
the progress in percents.

isDetermined

public boolean isDetermined()
Description copied from interface: Progressable
Checks whether the progress is determined.

Specified by:
isDetermined in interface Progressable
Returns:
true if the progress is determined, false otherwise.

getState

public ControllableState getState()
Description copied from interface: Progressable
Gets the controllable state.

Specified by:
getState in interface Controllable
Specified by:
getState in interface Progressable
Returns:
the controllable current state

addProgressableListener

public void addProgressableListener(ProgressableListener listener)
Description copied from interface: Progressable
Adds a ProgressableListener.

Specified by:
addProgressableListener in interface Progressable
Parameters:
listener - the ProgressableListener to add.

removeProgressableListener

public void removeProgressableListener(ProgressableListener listener)
Description copied from interface: Progressable
Removes a ProgressableListener.

Specified by:
removeProgressableListener in interface Progressable
Parameters:
listener - the ProgressableListener to remove.

clearProgressableListener

public void clearProgressableListener()
Description copied from interface: Progressable
Clears the list of listeners.

Specified by:
clearProgressableListener in interface Progressable

isInterrupted

public boolean isInterrupted()
Description copied from interface: Controllable
Checks whether this Controllable has been interrupted.

Specified by:
isInterrupted in interface Controllable
Returns:
true if the Controllable has been interrupted.

isInterruptible

public boolean isInterruptible()
Description copied from interface: Controllable
Checks whether this Controllable can be interrupted.

Specified by:
isInterruptible in interface Controllable
Returns:
true if the Controllable can be interrupted.

interrupt

public void interrupt()
Description copied from interface: Controllable
Sends to the command the order to interrupt its current tasks as soon as possible.

Specified by:
interrupt in interface Controllable

isPausable

public boolean isPausable()
Description copied from interface: Controllable
Checks whether this Controllable can be paused.

Specified by:
isPausable in interface Controllable
Returns:
true if the Controllable can be paused.

pause

public void pause()
Description copied from interface: Controllable
Pauses this Command.

Specified by:
pause in interface Controllable

resume

public void resume()
Description copied from interface: Controllable
Resumes a paused Command.

Specified by:
resume in interface Controllable

addControllableListener

public void addControllableListener(ControllableListener listener)
Description copied from interface: Controllable
Adds a ControllableListener.

Specified by:
addControllableListener in interface Controllable
Parameters:
listener - the ControllableListener to add.

removeControllableListener

public void removeControllableListener(ControllableListener listener)
Description copied from interface: Controllable
Removes a ControllableListener.

Specified by:
removeControllableListener in interface Controllable
Parameters:
listener - the ControllableListener to remove.

clearControllableListener

public void clearControllableListener()
Description copied from interface: Controllable
Clears the list of listeners.

Specified by:
clearControllableListener in interface Controllable


Copyright © 2010-2013 Artenum. All Rights Reserved.