sos.reports
Class DefaultReportEvent

java.lang.Object
  |
  +--sos.reports.DefaultReportEvent
All Implemented Interfaces:
ReportEvent

public class DefaultReportEvent
extends java.lang.Object
implements ReportEvent

An implementation of ReportEvent. It uses a map to store the elements' changes.

Since:
1.0

Nested Class Summary
static class DefaultReportEvent.DefaultElementChange
          An implementation of ReportEvent.ElementChange.
 
Nested classes inherited from class sos.reports.ReportEvent
 
Constructor Summary
DefaultReportEvent(Report report, Element sourceElement, ReportEvent.ElementChange change)
          Creates an instance of DefaultReportEvent where the specified report is the source and there is a single change to the specified element.
DefaultReportEvent(Report report, java.util.Map changes)
          Creates an instance of DefaultReportEvent where the specified report is the source and the specified map holds the elements' changes.
DefaultReportEvent(Report report, java.util.Set sourceElements, ReportEvent.ElementChange change)
          Creates an instance of DefaultReportEvent where the specified report is the source and there is a single change--the same to all elements in the specified set.
 
Method Summary
 ReportEvent.ElementChange getChange(Element element)
          Returns the details of how the specified element changed.
 Report getReport()
          Returns the report to which this event applies.
 java.util.Set getSourceElements()
          Returns the set of report elements for which this event applies.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultReportEvent

public DefaultReportEvent(Report report,
                          java.util.Map changes)
Creates an instance of DefaultReportEvent where the specified report is the source and the specified map holds the elements' changes.

Parameters:
report - source of the event
changes - mapping from Element to ElementChange

DefaultReportEvent

public DefaultReportEvent(Report report,
                          Element sourceElement,
                          ReportEvent.ElementChange change)
Creates an instance of DefaultReportEvent where the specified report is the source and there is a single change to the specified element.

Parameters:
report - source of the event
sourceElement - the only element that changed
change - the change to sourceElement

DefaultReportEvent

public DefaultReportEvent(Report report,
                          java.util.Set sourceElements,
                          ReportEvent.ElementChange change)
Creates an instance of DefaultReportEvent where the specified report is the source and there is a single change--the same to all elements in the specified set.

Parameters:
report - source of the event
sourceElements - the elements that changed
change - the change to each element in sourceElements
Method Detail

getReport

public Report getReport()
Description copied from interface: ReportEvent
Returns the report to which this event applies.

Specified by:
getReport in interface ReportEvent
Returns:
the report that changed

getSourceElements

public java.util.Set getSourceElements()
Description copied from interface: ReportEvent
Returns the set of report elements for which this event applies.

Specified by:
getSourceElements in interface ReportEvent
Returns:
the set of report elements for which this event applies

getChange

public ReportEvent.ElementChange getChange(Element element)
Description copied from interface: ReportEvent
Returns the details of how the specified element changed.

Specified by:
getChange in interface ReportEvent
Parameters:
element - element for which to fetch the change
Returns:
the details of how the specified element changed


Copyright 2003, 2004 Side of Software (SOS). All rights reserved.