pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.statistics.util
Class ResultIHasDurationDataMatrix<T extends IHasDuration,U extends IRowDataBuilder<T,V>,V extends AbstractRowData<T>>

java.lang.Object
  extended by org.torweg.pulse.component.statistics.util.ResultIHasDurationDataMatrix<T,U,V>
Type Parameters:
T - the IHasDuration implementation the ResultIHasDurationDataMatrix aggregates
U - the IRowDataBuilder
V - the underlying AbstractRowData row data implementation
All Implemented Interfaces:
java.io.Serializable, IHasDuration

public final class ResultIHasDurationDataMatrix<T extends IHasDuration,U extends IRowDataBuilder<T,V>,V extends AbstractRowData<T>>
extends java.lang.Object
implements IHasDuration, java.io.Serializable

A 2-dimensional matrix to further aggregate AbstractAggregations for display purposes, e.g. for creating table-like structures.

Version:
$Revision: 1620 $
Author:
Daniel Dietz
See Also:
Serialized Form

Constructor Summary
protected ResultIHasDurationDataMatrix()
          Deprecated. 
  ResultIHasDurationDataMatrix(U builder, Duration dur, Period dataResolution)
          Creates a new ResultIHasDurationDataMatrix with the given builder, duration and resolution and the default IHasDurationComparator for row comparison.
  ResultIHasDurationDataMatrix(U builder, Duration dur, Period dataResolution, IHasDurationComparator rowComparator)
          Creates a new ResultIHasDurationDataMatrix with the given builder, duration and resolution and the given customised IHasDurationComparator for row comparison.
 
Method Summary
 Duration getDuration()
          Returns the underlying "levelled" Duration.
 Period getResolution()
          Returns the underlying resolution: Period.
 java.util.Set<ResultIHasDurationDataMatrixRow<T,U,V>> getRows()
          Returns the data-rows of the ResultIHasDurationDataMatrix.
 void setData(java.util.Collection<T> data)
          Sets the data for the ResultIHasDurationDataMatrix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultIHasDurationDataMatrix

@Deprecated
protected ResultIHasDurationDataMatrix()
Deprecated. 

Default constructor.


ResultIHasDurationDataMatrix

public ResultIHasDurationDataMatrix(U builder, Duration dur, Period dataResolution)
Creates a new ResultIHasDurationDataMatrix with the given builder, duration and resolution and the default IHasDurationComparator for row comparison.

Parameters:
builder - the IRowDataBuilder
dur - the Duration
dataResolution - the Period

ResultIHasDurationDataMatrix

public ResultIHasDurationDataMatrix(U builder, Duration dur, Period dataResolution, IHasDurationComparator rowComparator)
Creates a new ResultIHasDurationDataMatrix with the given builder, duration and resolution and the given customised IHasDurationComparator for row comparison.

Parameters:
builder - the IRowDataBuilder
dur - the Duration
dataResolution - the Period
rowComparator - a customised IHasDurationComparator
Method Detail

getDuration

public Duration getDuration()
Returns the underlying "levelled" Duration.

Specified by:
getDuration in interface IHasDuration
Returns:
the underlying "levelled" Duration

getResolution

public Period getResolution()
Returns the underlying resolution: Period.

Returns:
the underlying Period

setData

public void setData(java.util.Collection<T> data)
Sets the data for the ResultIHasDurationDataMatrix.

NOTE: A IHasDuration from the given data will simply be skipped if its duration isn't contained by any of the durations' or equal to any of the durations' of the underlying rows.

Parameters:
data - a Collection&lt;IHasDuration&gt;

getRows

public java.util.Set<ResultIHasDurationDataMatrixRow<T,U,V>> getRows()
Returns the data-rows of the ResultIHasDurationDataMatrix.

Returns:
the rows