eShopper
Class eShopperAction

java.lang.Object
  extended byeShopper.eShopperAction

public class eShopperAction
extends java.lang.Object

This is a class that can represent any undoable action in eShopper. When actions are performed with eShopper, an instance of this class is created and added to the undo buffer.

Author:
Adam

Constructor Summary
eShopperAction()
           
 
Method Summary
 int getAction()
          This returns the type of action.
 java.lang.String getDate()
          This returns the date associated with the Action's node (if applicable).
 int getNodeID()
          This returns the ID of the node the action was performed on (if applicable).
 void setAction(int action, eShopperList list, eShopperNode changedNode)
          This allows the type of action to be set.
 void setNode(eShopperNode node)
          This sets the node the action was performed on (if applicable).
 void undoAction(eShopperList list)
          This reverses the affects of the action.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

eShopperAction

public eShopperAction()
Method Detail

setAction

public void setAction(int action,
                      eShopperList list,
                      eShopperNode changedNode)
This allows the type of action to be set. The available types are: 1: Clear List 2: Add Item 3: Remove Item

Parameters:
action - The type of action.
list - The list upon which the action was performed.

getAction

public int getAction()
This returns the type of action. The types that can be returned are: 1: Clear List 2: Add Item 3: Remove Item

Returns:
An integer representing the type of action performed.

undoAction

public void undoAction(eShopperList list)
This reverses the affects of the action.


setNode

public void setNode(eShopperNode node)
This sets the node the action was performed on (if applicable).

Parameters:
node - The eShopper node upon which the action was performed.

getNodeID

public int getNodeID()
This returns the ID of the node the action was performed on (if applicable).

Returns:
The ID of the node the action was performed on, if it exists; otherwise, 0.

getDate

public java.lang.String getDate()
This returns the date associated with the Action's node (if applicable).

Returns:
The date associated with the Action's node, if it exists; otherwise, null.