org.mars_sim.msp.simulation.events
Class HistoricalEvent

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

public abstract class HistoricalEvent
extends java.lang.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(java.lang.String category, java.lang.String type, java.lang.Object source, java.lang.String description)
          Construct an event with the appropriate information.
 
Method Summary
 java.lang.String getCategory()
           
 java.lang.String getDescription()
          Get description.
 java.lang.Object getSource()
          Get the Unit source.
 MarsClock getTimestamp()
          Get event time.
 java.lang.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(java.lang.String category,
                       java.lang.String type,
                       java.lang.Object source,
                       java.lang.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 java.lang.String getDescription()
Get description.

Returns:
Description

getSource

public java.lang.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 java.lang.String getType()
Get the type of event.

Returns:
String representing the type.

getCategory

public java.lang.String getCategory()