com.miginfocom.util.command
Class AbstractCommand

java.lang.Object
  extended by com.miginfocom.util.command.AbstractCommand
All Implemented Interfaces:
Command, java.io.Serializable
Direct Known Subclasses:
AnimatorCommand, DefaultCommand

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

Default implementation of a command. Has an id that can optionally be auto generated and will be uniqe for all sublcasses of this class.

See Also:
Serialized Form

Constructor Summary
protected AbstractCommand(java.lang.Object id)
          Constructor.
 
Method Summary
protected static java.lang.Object createUniqeID()
          Returns a unique id.
 boolean equals(java.lang.Object o)
          Compares id.
 java.lang.Object getID()
          Returns the ID.
 boolean isEnabled()
           
 void setEnabled(boolean b)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.miginfocom.util.command.Command
execute
 

Constructor Detail

AbstractCommand

protected AbstractCommand(java.lang.Object id)
Constructor.

Parameters:
id - The id. Never null. Use createUniqeID() to get an id if not a particular one should be used.
Method Detail

getID

public java.lang.Object getID()
Description copied from interface: Command
Returns the ID.

Specified by:
getID in interface Command
Returns:
The id. Never null.

isEnabled

public boolean isEnabled()

setEnabled

public void setEnabled(boolean b)

equals

public boolean equals(java.lang.Object o)
Compares id.

Overrides:
equals in class java.lang.Object

createUniqeID

protected static java.lang.Object createUniqeID()
Returns a unique id. (Currenty an Integer increased by one for every call.)

Returns:
A unique id.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.