de.upb.swtpra05.group03.shuttle
Class OrderContainer

java.lang.Object
  extended byde.upb.swtpra05.group03.shuttle.OrderContainer
All Implemented Interfaces:
Module, OrderContainerInterface

public class OrderContainer
extends java.lang.Object
implements Module, OrderContainerInterface

Contains orders mapped with their order id as key.

Version:
$Revision: 1.3 $

Field Summary
private  java.util.Map orders
          the ExtendedOrderObjects
 
Constructor Summary
OrderContainer()
          Constructor
 
Method Summary
 void add(ExtendedOrder newExtOrder)
          Adds a new ExtendedOrder to the collection
 ExtendedOrder get(int oID)
          Get an ExtendedOrder from the collection which is identified by it's id attribute
 ExtendedOrder get(de.upb.swtpra.kernel.id.OrderID oID)
          Get an ExtendedOrder from the collection which is identified by it's id attribute
 void init(ModuleContainerInterface container)
          Initializes this module.
 java.util.Iterator iterator()
           
 void remove(de.upb.swtpra.kernel.id.OrderID oID)
          Removes an ExtendedOrder from the collection which is identified by it's id attribute
 java.lang.String toPickabackString()
          Iterates through all ExtendedOrders and generates a PickabackString (e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

orders

private final java.util.Map orders
the ExtendedOrderObjects

Constructor Detail

OrderContainer

public OrderContainer()
Constructor

Method Detail

init

public void init(ModuleContainerInterface container)
Description copied from interface: Module
Initializes this module. References to other modules should be set here to avoid circle dependencies.

Specified by:
init in interface Module
Parameters:
container - The module manager which contain all modules

add

public void add(ExtendedOrder newExtOrder)
Description copied from interface: OrderContainerInterface
Adds a new ExtendedOrder to the collection

Specified by:
add in interface OrderContainerInterface
Parameters:
newExtOrder - The ExtendOrder to add

get

public ExtendedOrder get(de.upb.swtpra.kernel.id.OrderID oID)
Description copied from interface: OrderContainerInterface
Get an ExtendedOrder from the collection which is identified by it's id attribute

Specified by:
get in interface OrderContainerInterface
Parameters:
oID - The identification attribute of the ExtendedOrder
Returns:
An instance of the ExtendedOrder object with this id value or null if it doesn't exist

get

public ExtendedOrder get(int oID)
Description copied from interface: OrderContainerInterface
Get an ExtendedOrder from the collection which is identified by it's id attribute

Specified by:
get in interface OrderContainerInterface
Parameters:
oID - The identification attribute of the ExtendedOrder
Returns:
An instance of the ExtendedOrder object with this id value or null if it doesn't exist

remove

public void remove(de.upb.swtpra.kernel.id.OrderID oID)
Description copied from interface: OrderContainerInterface
Removes an ExtendedOrder from the collection which is identified by it's id attribute

Specified by:
remove in interface OrderContainerInterface
Parameters:
oID - The identification attribute of the ExtendedOrder

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface OrderContainerInterface
Returns:
An iterator over the ExtendedOrders

toPickabackString

public java.lang.String toPickabackString()
Description copied from interface: OrderContainerInterface
Iterates through all ExtendedOrders and generates a PickabackString (e.g. calls Object.toPickabackString(), used from PluginMessenger.

Specified by:
toPickabackString in interface OrderContainerInterface
Returns:
the resulting PickabackString as a String