jmarkov
Class EventsSet<E extends Event>

java.lang.Object
  extended by jmarkov.EventsSet<E>

public class EventsSet<E extends Event>
extends java.lang.Object

This class represent a set of Events. The set should be build at the beggining and should not be changed in any way afterwards.

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

Constructor Summary
EventsSet()
          Creates an empty set of Events;
 
Method Summary
 boolean add(E e)
          Adds the Event e to the set.
 boolean contains(Event e)
          Returns true if the set contains this Event.
static EventsSet<Event> createEventSet(int numE)
          Creates a set with numE Events.
 E[] toEventArray()
          Returns an array with the Events in the set.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EventsSet

public EventsSet()
Creates an empty set of Events;

Method Detail

createEventSet

public static EventsSet<Event> createEventSet(int numE)
Creates a set with numE Events.

Parameters:
numE - The number of events.

add

public boolean add(E e)
Adds the Event e to the set.

Parameters:
e - The event to be added.
Returns:
True if the set did not already contained this event.

contains

public boolean contains(Event e)
Returns true if the set contains this Event.


toEventArray

public E[] toEventArray()
Returns an array with the Events in the set.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()