classes.container
Class ShapeContainerContext

java.lang.Object
  extended by classes.container.ShapeContainerContext

public class ShapeContainerContext
extends java.lang.Object

Performs the operations based on the state of the container

Version:
1.0, 22-Mar-07
Author:
Prathab, Mukesh

Field Summary
 ShapeContainer shapeContainer
           
 IShapeContainerState shapeContainerState
           
 int shapeObjectsCount
           
 
Constructor Summary
ShapeContainerContext(ShapeContainer shapeContainer, IShapeContainerState shapeContainerState)
          Initialize with the container and current state object
 
Method Summary
 boolean addShape(IShape shape)
          Adds the given shape to the container based on the state of the coantiner.
 boolean removeShape(IShape shape)
          Removes the given shape from the container based on the state of the coantiner.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shapeContainer

public ShapeContainer shapeContainer

shapeContainerState

public IShapeContainerState shapeContainerState

shapeObjectsCount

public int shapeObjectsCount
Constructor Detail

ShapeContainerContext

public ShapeContainerContext(ShapeContainer shapeContainer,
                             IShapeContainerState shapeContainerState)
Initialize with the container and current state object

Parameters:
shapeContainer - shape container on which operations are performed
shapeContainerState - current state of the shape container
Method Detail

addShape

public boolean addShape(IShape shape)
Adds the given shape to the container based on the state of the coantiner.

Parameters:
shape - the shape to be added

removeShape

public boolean removeShape(IShape shape)
Removes the given shape from the container based on the state of the coantiner.

Parameters:
shape - the shape to be removed