de.upb.swtpra05.group03.shuttle
Class Company

java.lang.Object
  extended byde.upb.swtpra05.group03.shuttle.Company
All Implemented Interfaces:
CompanyInterface, Module, ShuttleModule

public class Company
extends java.lang.Object
implements ShuttleModule, CompanyInterface

This class represents a company with one or more shuttles and stores the count and the ids of the associated shuttles.

Version:
$Revision: 1.3 $

Field Summary
private  java.util.SortedSet associateIDs
          The Associates of the shuttle
private static java.util.logging.Logger log
          Logger for debugging
 
Constructor Summary
Company()
          Constructor
 
Method Summary
 java.util.SortedSet getAssociateIDs()
          Returns a sorted set containing the associate IDs of the shuttle.
 int getCompanySize()
          Returns the company size.
 void init(ModuleContainerInterface container)
          Initializes this module.
 void newMessageReceived(de.upb.swtpra.kernel.message.Message msg)
          React on the received message of the shuttle or not.
private  void newShuttle(NewShuttleMessage msg)
          Adds the new shuttle to the associate ids.
private  void shuttleAssociates(de.upb.swtpra.kernel.message.ShuttleAssociates msg)
          Sets the associate ids.
private  void shuttleDisqualified(de.upb.swtpra.kernel.message.ShuttleDisqualifiedMessage msg)
          Removes the disqualified shuttle from the associate ids.
private  void shuttleSold(de.upb.swtpra.kernel.message.ShuttleSoldMessage msg)
          Removes the sold shuttle from the associate ids.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final java.util.logging.Logger log
Logger for debugging


associateIDs

private java.util.SortedSet associateIDs
The Associates of the shuttle

Constructor Detail

Company

public Company()
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

newMessageReceived

public void newMessageReceived(de.upb.swtpra.kernel.message.Message msg)
Description copied from interface: ShuttleModule
React on the received message of the shuttle or not.

Specified by:
newMessageReceived in interface ShuttleModule
Parameters:
msg - The received message of the shuttle

shuttleSold

private void shuttleSold(de.upb.swtpra.kernel.message.ShuttleSoldMessage msg)
Removes the sold shuttle from the associate ids.

Parameters:
msg - The ShuttleSoldMessage

shuttleDisqualified

private void shuttleDisqualified(de.upb.swtpra.kernel.message.ShuttleDisqualifiedMessage msg)
Removes the disqualified shuttle from the associate ids.

Parameters:
msg - The ShuttleDisqualifiedMessage

newShuttle

private void newShuttle(NewShuttleMessage msg)
Adds the new shuttle to the associate ids.

Parameters:
msg - The NewShuttleMessage

shuttleAssociates

private void shuttleAssociates(de.upb.swtpra.kernel.message.ShuttleAssociates msg)
Sets the associate ids.

Parameters:
msg - The ShuttleAssociates message

getAssociateIDs

public java.util.SortedSet getAssociateIDs()
Description copied from interface: CompanyInterface
Returns a sorted set containing the associate IDs of the shuttle.

Specified by:
getAssociateIDs in interface CompanyInterface
Returns:
a sorted set containing the associate IDs of the shuttle

getCompanySize

public int getCompanySize()
Description copied from interface: CompanyInterface
Returns the company size.

Specified by:
getCompanySize in interface CompanyInterface
Returns:
The company size