atg.service.datacollection
Class SummaryItem

java.lang.Object
  extended by atg.service.datacollection.SummaryItem
All Implemented Interfaces:
atg.core.util.Sortable

public class SummaryItem
extends java.lang.Object
implements atg.core.util.Sortable

A data item that holds summary information.

See Also:
GenericSummarizer

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
SummaryItem(java.lang.Object pDataItem, java.lang.String[] pGroupByFields)
          Construct a summary event that will summarize the given "type" of data item.
 
Method Summary
 int compareTo(atg.core.util.Sortable s)
          Compare to the specfied summary event.
 boolean equals(java.lang.Object pOther)
          Determine if this object is equal to another.
 java.sql.Timestamp getCurrentTime()
          Returns property CurrentTime, computed each time it is called.
 long getCurrentTimeMillis()
          Returns property CurrentTimeMillis, computed each time it is called
 java.lang.Object getDataItem()
          Returns property DataItem
 int getSummaryCount()
          Returns property SummaryCount
 java.sql.Timestamp getSummaryFromTime()
          Returns property SummaryFromTime
 long getSummaryFromTimeMillis()
          Returns property SummaryFromTimeMillis
 java.sql.Timestamp getSummaryToTime()
          Returns property SummaryToTime
 long getSummaryToTimeMillis()
          Returns property SummaryToTimeMillis
 int hashCode()
          Get hashcode for this object
 void setSummaryFromTimeMillis(long pSummaryFromTimeMillis)
          Sets property SummaryFromTimeMillis
 void setSummaryToTimeMillis(long pSummaryToTimeMillis)
          Sets property SummaryToTimeMillis
 java.lang.String toString()
          Get a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

SummaryItem

public SummaryItem(java.lang.Object pDataItem,
                   java.lang.String[] pGroupByFields)
Construct a summary event that will summarize the given "type" of data item. The "type" here is actually the combination of the class of the data item and the list of properties in it that we will use.

Parameters:
pDataItem - the data item we are summarizing
pGroupByFields - a list of the property names that we group by for summarizing. We ignore other properties.
Method Detail

getCurrentTimeMillis

public long getCurrentTimeMillis()
Returns property CurrentTimeMillis, computed each time it is called


getCurrentTime

public java.sql.Timestamp getCurrentTime()
Returns property CurrentTime, computed each time it is called.


getSummaryCount

public int getSummaryCount()
Returns property SummaryCount


getDataItem

public java.lang.Object getDataItem()
Returns property DataItem


setSummaryFromTimeMillis

public void setSummaryFromTimeMillis(long pSummaryFromTimeMillis)
Sets property SummaryFromTimeMillis


getSummaryFromTimeMillis

public long getSummaryFromTimeMillis()
Returns property SummaryFromTimeMillis


getSummaryFromTime

public java.sql.Timestamp getSummaryFromTime()
Returns property SummaryFromTime


setSummaryToTimeMillis

public void setSummaryToTimeMillis(long pSummaryToTimeMillis)
Sets property SummaryToTimeMillis


getSummaryToTimeMillis

public long getSummaryToTimeMillis()
Returns property SummaryToTimeMillis


getSummaryToTime

public java.sql.Timestamp getSummaryToTime()
Returns property SummaryToTime


compareTo

public int compareTo(atg.core.util.Sortable s)
Compare to the specfied summary event. We go thru the list of group by properties and compare each of those in turn. It is important that the Sortable passed in is a SummaryItem with the same group by list.

Specified by:
compareTo in interface atg.core.util.Sortable

toString

public java.lang.String toString()
Get a string representation of this object.

Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Get hashcode for this object

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object pOther)
Determine if this object is equal to another. The flexible nature of the summarizer means that this entails several (possible dynamic) bean property retrievals. If this turns out to be undesirable, could build an array of the group by property values when a SummaryItem is instantiated. This is only warranted if the performance of the summarizer becomes a problem.

Overrides:
equals in class java.lang.Object
Parameters:
pOther - object to compare to