i3.dragos.core.services.commands
Interface Command

All Known Subinterfaces:
MoveCommand, RetypeCommand

public interface Command

Commands represent operation objects, which may be executed by some CommandProcessor.

Author:
Erhard Weinell <Weinell@cs.RWTH-Aachen.DE>

Method Summary
 boolean canExecute()
           
 void dispose()
          Removes any result values and disposed this command object.
 void execute()
          Executes this command and stores results.
 java.lang.Object[] getActualParameterValues()
          Inquiry method for reflexive consistency checking - returns the actual parameter values of this command instance.
 java.lang.Class<?>[] getFormalParameterTypes()
          Inquiry method for reflexive consistency checking - should be based on static final values.
 CommandProvider getProvider()
           
 java.lang.Object getResult()
           
 

Method Detail

canExecute

boolean canExecute()
Returns:
whether this command object can be executed momentarily.

execute

void execute()
Executes this command and stores results.

Throws:
java.lang.RuntimeException - if canExecute() yields false.

getResult

java.lang.Object getResult()
                           throws java.lang.IllegalStateException,
                                  ExecutionAbortedException
Returns:
the result value after execution.
Throws:
java.lang.IllegalStateException - if the command was not executed yet.
ExecutionAbortedException

dispose

void dispose()
Removes any result values and disposed this command object. Should only be utilized as last invocation on this object.


getProvider

CommandProvider getProvider()
Returns:
the Provider which created this command.

getFormalParameterTypes

java.lang.Class<?>[] getFormalParameterTypes()
Inquiry method for reflexive consistency checking - should be based on static final values.

Returns:
an array of formal parameter types.

getActualParameterValues

java.lang.Object[] getActualParameterValues()
Inquiry method for reflexive consistency checking - returns the actual parameter values of this command instance.

Returns:
the actual parameter values of this command instance.


Copyright © 2002-2008 RWTH Aachen, Department of Computer Science 3 (Software Engineering). All Rights Reserved.