org.mars_sim.msp.core.events
Class HistoricalEvent

java.lang.Object
  extended by org.mars_sim.msp.core.events.HistoricalEvent
Direct Known Subclasses:
MalfunctionEvent, MedicalEvent, MissionHistoricalEvent, TaskEvent, TransportEvent

public abstract class HistoricalEvent
extends Object

This class represents a time based event that has occuried in the simulation. It is aimed at being subclassed to reflect the real simulation specific events. An event consists of a time stamp when it occured, a description, an optional Unit that is the source of the event and an optional Object that has triggered the event.


Constructor Summary
HistoricalEvent(String category, String type, Object source, String description)
          Construct an event with the appropriate information.
 
Method Summary
 String getCategory()
           
 String getDescription()
          Get description.
 Object getSource()
          Get the Unit source.
 MarsClock getTimestamp()
          Get event time.
 String getType()
          Get the type of event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HistoricalEvent

public HistoricalEvent(String category,
                       String type,
                       Object source,
                       String description)
Construct an event with the appropriate information. The time is not defined until the evnet is registered with the Event Manager.

Parameters:
category - Category of event.
type - Type of event.
source - The object that has produced the event, if this is null then it is a global simulation event. It could be a Unit or a Building.
description - Long description of event.
See Also:
HistoricalEventManager.registerNewEvent(HistoricalEvent)
Method Detail

getDescription

public String getDescription()
Get description.

Returns:
Description

getSource

public Object getSource()
Get the Unit source.

Returns:
Object as the source of event.

getTimestamp

public MarsClock getTimestamp()
Get event time.

Returns:
Time the event happened

getType

public String getType()
Get the type of event.

Returns:
String representing the type.

getCategory

public String getCategory()


Copyright © 2009-2013. All Rights Reserved.