org.hackystat.projectbrowser.page.sensordata
Class SensorDataDetailsProvider

java.lang.Object
  extended by org.hackystat.projectbrowser.page.sensordata.SensorDataDetailsProvider
All Implemented Interfaces:
java.io.Serializable, org.apache.wicket.IClusterable, org.apache.wicket.markup.repeater.data.IDataProvider, org.apache.wicket.model.IDetachable

public class SensorDataDetailsProvider
extends java.lang.Object
implements org.apache.wicket.markup.repeater.data.IDataProvider

Provides an IDataProvider for the SensorDataDetails panel. The goal of this implementation is to support a pageable list view of the selected sensor data, where each page is retrieved from the SensorBase when it is actually requested by the user.

Author:
Philip Johnson
See Also:
Serialized Form

Constructor Summary
SensorDataDetailsProvider()
          Creates an empty SensorDataDetailsProvider.
 
Method Summary
 void detach()
          Hook for detachable models, but we're not doing that yet.
 boolean isEmpty()
          Returns true if this model does not contain any data.
 java.util.Iterator iterator(int first, int count)
          Provides an iterator over the specified subset of SensorData.
 org.apache.wicket.model.IModel model(java.lang.Object data)
          Callback used by the consumer of this data provider to wrap SensorDataDetails instances retrieved from iterator(int, int) with a model (usually a detachable one).
 void setSensorDataDetailsProvider(java.lang.String sdtName, java.lang.String tool, long start)
          Used by the SdtSummary link to indicate how the model should be updated.
 int size()
          The total number of items in this provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SensorDataDetailsProvider

public SensorDataDetailsProvider()
Creates an empty SensorDataDetailsProvider.

Method Detail

setSensorDataDetailsProvider

public void setSensorDataDetailsProvider(java.lang.String sdtName,
                                         java.lang.String tool,
                                         long start)
Used by the SdtSummary link to indicate how the model should be updated.

Parameters:
sdtName - The sdtName.
tool - The tool.
start - The start time.

iterator

public java.util.Iterator iterator(int first,
                                   int count)
Provides an iterator over the specified subset of SensorData.

Specified by:
iterator in interface org.apache.wicket.markup.repeater.data.IDataProvider
Parameters:
first - The first row to display.
count - The minimum number of rows that the iterator will work on.
Returns:
The iterator for the specified range.

model

public org.apache.wicket.model.IModel model(java.lang.Object data)
Callback used by the consumer of this data provider to wrap SensorDataDetails instances retrieved from iterator(int, int) with a model (usually a detachable one).

Specified by:
model in interface org.apache.wicket.markup.repeater.data.IDataProvider
Parameters:
data - The SensorDataDetails instance returned from the iterator that needs to be wrapped.
Returns:
A model that wraps this instance.

size

public int size()
The total number of items in this provider.

Specified by:
size in interface org.apache.wicket.markup.repeater.data.IDataProvider
Returns:
The total size of this model.

detach

public void detach()
Hook for detachable models, but we're not doing that yet.

Specified by:
detach in interface org.apache.wicket.model.IDetachable

isEmpty

public boolean isEmpty()
Returns true if this model does not contain any data.

Returns:
True if no data.