net.refractions.udig.project.command
Class AbstractCommand

java.lang.Object
  extended by net.refractions.udig.project.command.AbstractCommand
All Implemented Interfaces:
Command, MapCommand
Direct Known Subclasses:
SetLayerVisibilityCommand, UndoRedoCommand

public abstract class AbstractCommand
extends java.lang.Object
implements MapCommand

TODO Purpose of net.refractions.udig.project.command

Since:
1.0.0
Author:
Jesse

Constructor Summary
AbstractCommand()
           
 
Method Summary
 Command copy()
          Instantiates a new copy of the command that will operate in the same manner as the original command.
 Map getMap()
          Returns the map if called during execute (or undo command is an undoable command) API mutable?
 void setMap(IMap map2)
          Called when before the command is executed.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.refractions.udig.project.command.Command
getName, run
 

Constructor Detail

AbstractCommand

public AbstractCommand()
Method Detail

setMap

public void setMap(IMap map2)
Description copied from interface: MapCommand
Called when before the command is executed. API mutable?throw unsupportedexception?

Specified by:
setMap in interface MapCommand
Parameters:
map2 - The map executing the command.
See Also:
MapCommand.setMap(IMap)

getMap

public Map getMap()
Description copied from interface: MapCommand
Returns the map if called during execute (or undo command is an undoable command) API mutable?

Specified by:
getMap in interface MapCommand
Returns:
the map if called during execute (or undo command is an undoable command)
See Also:
MapCommand.getMap()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

copy

public Command copy()
Description copied from interface: Command
Instantiates a new copy of the command that will operate in the same manner as the original command. API isn't this cloneable?

Specified by:
copy in interface Command
Returns:
A copy of the current command. The new command must run the same way as the current object.

If the current command has already executed it cannot be used again, but a copy may because a copy should contain none of the state side-effect that execution has on a command