jmarkov.basic
Class Event

java.lang.Object
  extended by jmarkov.basic.Event
All Implemented Interfaces:
java.lang.Comparable<Event>, JMarkovElement
Direct Known Subclasses:
PropertiesEvent

public abstract class Event
extends java.lang.Object
implements java.lang.Comparable<Event>, JMarkovElement

The class Event allows the user to define the implementation of the Events that can alter the States of the Markov Chain.

Author:
Germán Riaño. Universidad de los Andes.

Constructor Summary
Event()
           
 
Method Summary
 int compareTo(Event ev)
          Returns positive if this Event has a higher number then the given event.
 java.lang.String description()
          It is highly recommended that the user overrides it to give a description to be used when reporting the occurrance rates of the events, and GUI.
 boolean equals(java.lang.Object o)
          This method calls compareTo to check if the Action are equal.
 int getIndex()
          Gives the position of the Event in the Events set.
 EventsSet getSet()
          Returns the set of Events to which this event belongs.
 java.lang.String label()
          If this function is not overriden by the user it returns the Event number.
 java.lang.String toString()
          This method returns a short String used in the user interface to describe this element.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Event

public Event()
Method Detail

getSet

public EventsSet getSet()
Returns the set of Events to which this event belongs.

Returns:
the set to which this event belongs.

getIndex

public int getIndex()
Gives the position of the Event in the Events set. Returns -1 if this events has not yet been added to the set.

Returns:
The position of the Event in the Events set. Returns -1 if this events has not yet been added to the set.

compareTo

public int compareTo(Event ev)
Returns positive if this Event has a higher number then the given event.

Specified by:
compareTo in interface java.lang.Comparable<Event>
See Also:
Comparable.compareTo(Object)

label

public java.lang.String label()
If this function is not overriden by the user it returns the Event number. The user should override to give a short label description of the Event. It is highly recommended that the user overrides it to give a more descriptive label to be used when reporting the occurrance rates of the events.

Specified by:
label in interface JMarkovElement
Returns:
A short string description of the Event.
See Also:
description()

description

public java.lang.String description()
It is highly recommended that the user overrides it to give a description to be used when reporting the occurrance rates of the events, and GUI.

Specified by:
description in interface JMarkovElement
Returns:
a String description
See Also:
label()

toString

public final java.lang.String toString()
Description copied from interface: JMarkovElement
This method returns a short String used in the user interface to describe this element. It is highly recommended that every class calls label(), using the following code:
 public final String toString() {
     return label();
 }
 

Specified by:
toString in interface JMarkovElement
Overrides:
toString in class java.lang.Object
Returns:
A String label.
See Also:
JMarkovElement.label()

equals

public final boolean equals(java.lang.Object o)
This method calls compareTo to check if the Action are equal.

Specified by:
equals in interface JMarkovElement
Overrides:
equals in class java.lang.Object
Parameters:
o - The Object to compare to.
Returns:
True if the elements are equal.
See Also:
Object.equals(java.lang.Object)