classes.container.state
Class ShapeContainerEmptyState

java.lang.Object
  extended by interfaces.CommandColleague
      extended by classes.container.state.ShapeContainerEmptyState
All Implemented Interfaces:
IShapeContainerState

public class ShapeContainerEmptyState
extends CommandColleague
implements IShapeContainerState

Performs the operations based on the empty state of the container

Version:
1.0, 22-Mar-07
Author:
Prathab, Mukesh
See Also:
ShapeContainer, IShapeContainerState

Field Summary
 
Fields inherited from class interfaces.CommandColleague
commandMediator
 
Method Summary
 boolean addShape(ShapeContainerContext shapeContainerContext, IShape shape)
          Adds the given shape to container based on the partial filled state
static ShapeContainerEmptyState getInstance(ICommandMediator commandMediator)
          Creates the ShapeContainerFullState object and returns same object if it is already created (singleton).
 boolean removeShape(ShapeContainerContext shapeContainerContext, IShape shape)
          Removes the given shape from the container based on the partial filled state
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ShapeContainerEmptyState getInstance(ICommandMediator commandMediator)
Creates the ShapeContainerFullState object and returns same object if it is already created (singleton).

Parameters:
commandMediator - mediator object to communicate with other objects
Returns:
Instance of ShapeContainerFullState object

addShape

public boolean addShape(ShapeContainerContext shapeContainerContext,
                        IShape shape)
Adds the given shape to container based on the partial filled state

Specified by:
addShape in interface IShapeContainerState
Parameters:
shapeContainerContext - shape container context which holds the details of the shape container
shape - shape to be added
Returns:
true if shape is added
See Also:
IShapeContainerState.addShape(classes.container.ShapeContainerContext, interfaces.IShape)

removeShape

public boolean removeShape(ShapeContainerContext shapeContainerContext,
                           IShape shape)
Removes the given shape from the container based on the partial filled state

Specified by:
removeShape in interface IShapeContainerState
Parameters:
shapeContainerContext - shape container context which holds the details of the shape container
shape - shape to be removed
Returns:
true if shape is removed
See Also:
IShapeContainerState.removeShape(classes.container.ShapeContainerContext, interfaces.IShape)