FantasySportsModule 0.0.2-dev

org.fanfoot.scoring
Class Events

java.lang.Object
  |
  +--org.fanfoot.scoring.Events

public class Events
extends java.lang.Object

A collection of Events that have happened in a real game that may affect the fantasy game.

Author:
rgardler
See Also:
Event

Constructor Summary
Events()
          Creates a new instance of Events
Events(java.lang.String strUID)
          Creates a new instance of Events
 
Method Summary
 void add(Event evt)
          Add the supplied event to the Events list.
 void addAll(Events evts)
          Add all the supplied events to this Events collection.
 void addAll(Events evts, EventParserConfiguration conf)
          Add all the supplied events to this Events collection.
protected  boolean arePartsEqual(java.lang.String partValue1, java.lang.String partValue2)
          Test to see if the two supplied part values are equal
 boolean contains(Event evt, EventParserConfiguration conf)
          Checks to see if this events collection contains the supplied event by checking against the duplicateDetection config in the configuration file.
 Event getEvent(int idx)
          Get the event at the given index
 java.util.List getEvents()
          Get the collection of events
 java.util.ArrayList getEventsByType(java.lang.String strType)
          Get all events in the collection of the indicated type.
 java.lang.String getSrcData()
          Getter for property srcData.
 java.util.Enumeration getTypes()
          Get the names of all event types present
 java.lang.String getUID()
          Getter for the unique identifier for this groups of events
 java.util.Iterator iterator()
          Get an iterator over all the events.
 void setSrcData(java.lang.String srcData)
          Setter for property srcData.
 void setUID(java.lang.String uid)
          Setter for the unique identifier for this groups of events
 int size()
          Get the number of events in this collection.
 org.w3c.dom.Document toXMLDoc()
          Return an XML DOM representation of this event
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Events

public Events()
Creates a new instance of Events


Events

public Events(java.lang.String strUID)
Creates a new instance of Events

Parameters:
strUID - a unique identifier for this set of events, must be application unique
Method Detail

getEvents

public java.util.List getEvents()
Get the collection of events

Returns:
the collection of events

iterator

public java.util.Iterator iterator()
Get an iterator over all the events.

Returns:
an iterator over all events

getEvent

public Event getEvent(int idx)
Get the event at the given index

Parameters:
idx - the index number of the event required
Returns:
the collection of events

add

public void add(Event evt)
Add the supplied event to the Events list.

Parameters:
evt - The event to add

size

public int size()
Get the number of events in this collection.

Returns:
int number of events in collection

addAll

public void addAll(Events evts)
Add all the supplied events to this Events collection.

Parameters:
evts - the events to add

addAll

public void addAll(Events evts,
                   EventParserConfiguration conf)
Add all the supplied events to this Events collection. FIXME: implement duplicate checking If a duplicate event (as indicated by the events configuration file) is located then the second event is marked as a duplicate and both events are marked as requireing validation.

Parameters:
evts - the events to add
conf - the vonfiguration for these events

contains

public boolean contains(Event evt,
                        EventParserConfiguration conf)
Checks to see if this events collection contains the supplied event by checking against the duplicateDetection config in the configuration file.

Parameters:
evt - the event to check for
conf - the event parser configuration
Returns:
true if the events collection contains an identical event allready

arePartsEqual

protected boolean arePartsEqual(java.lang.String partValue1,
                                java.lang.String partValue2)
Test to see if the two supplied part values are equal

Parameters:
partValue1 - the first part value
partValue2 - the second part value
Returns:
true if the parts are equal

getTypes

public java.util.Enumeration getTypes()
Get the names of all event types present

Returns:
Enumeration of all event types

getEventsByType

public java.util.ArrayList getEventsByType(java.lang.String strType)
Get all events in the collection of the indicated type.

Parameters:
strType - the type of event requried
Returns:
an ArrayList of all events of the supplied type

getUID

public java.lang.String getUID()
Getter for the unique identifier for this groups of events

Returns:
Value of property UID.

setUID

public void setUID(java.lang.String uid)
Setter for the unique identifier for this groups of events

Parameters:
uid - New value of property UID.

getSrcData

public java.lang.String getSrcData()
Getter for property srcData.

Returns:
Value of property srcData.

setSrcData

public void setSrcData(java.lang.String srcData)
Setter for property srcData.

Parameters:
srcData - New value of property srcData.

toXMLDoc

public org.w3c.dom.Document toXMLDoc()
                              throws javax.xml.parsers.ParserConfigurationException
Return an XML DOM representation of this event

Returns:
Document XML DOM representation of this event
Throws:
javax.xml.parsers.ParserConfigurationException - if there is a problem with the XML parser

FantasySportsModule 0.0.2-dev

Copyright © 2003 We know What you Want.net. All Rights Reserved.