org.hackystat.telemetry.analyzer.model
Class TelemetryStreamCollection

java.lang.Object
  extended by org.hackystat.telemetry.analyzer.model.TelemetryStreamCollection
All Implemented Interfaces:
java.lang.Iterable<TelemetryStream>

public class TelemetryStreamCollection
extends java.lang.Object
implements java.lang.Iterable<TelemetryStream>

Provides a collection of telemetry streams. Note that this class does not constrain what kind of telemetry streams are present in a collection. Typically, you want to add only related streams, and each stream should contain points over the same interval.

Thread Safety: methods in this class are not synchronized.

Author:
(Cedric) Qin Zhang

Constructor Summary
TelemetryStreamCollection(java.lang.String name, org.hackystat.sensorbase.resource.projects.jaxb.Project project, org.hackystat.utilities.time.interval.Interval interval)
          Constructs this instance.
 
Method Summary
 void add(TelemetryStream stream)
          Adds a telemetry stream to this collection.
 TelemetryStream get(java.lang.Object tag)
          Gets telemetry stream by tag value.
 org.hackystat.utilities.time.interval.Interval getInterval()
          Gets the interval tag.
 java.lang.String getName()
          Gets the name tag.
 org.hackystat.sensorbase.resource.projects.jaxb.Project getProject()
          Gets the project tag.
 java.util.Collection<TelemetryStream> getTelemetryStreams()
          Gets all the telemetry streams contained in this collection.
 java.util.Iterator<TelemetryStream> iterator()
          Return an iterator over the TelemetryStreams in this collection.
 void setName(java.lang.String name)
          Sets the name tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TelemetryStreamCollection

public TelemetryStreamCollection(java.lang.String name,
                                 org.hackystat.sensorbase.resource.projects.jaxb.Project project,
                                 org.hackystat.utilities.time.interval.Interval interval)
Constructs this instance. The project and the interval are just tags, they are not used to constrain the kind of streams that can be added. (Maybe I should do this :=)).

Parameters:
name - The name of this telemetry streams collection.
project - The project.
interval - The interval.
Method Detail

setName

public void setName(java.lang.String name)
Sets the name tag.

Parameters:
name - The name tag.

getName

public java.lang.String getName()
Gets the name tag.

Returns:
The name tag.

getProject

public org.hackystat.sensorbase.resource.projects.jaxb.Project getProject()
Gets the project tag.

Returns:
The project tag.

getInterval

public org.hackystat.utilities.time.interval.Interval getInterval()
Gets the interval tag.

Returns:
The interval tag.

add

public void add(TelemetryStream stream)
         throws TelemetryDataModelException
Adds a telemetry stream to this collection.

Parameters:
stream - The telemetry stream to be added.
Throws:
TelemetryDataModelException - If there is already a stream with the same tag.

get

public TelemetryStream get(java.lang.Object tag)
Gets telemetry stream by tag value.

Parameters:
tag - Telemetry stream tag. Null is a valid value.
Returns:
TelemetryStream The telemetry stream, or null if it does not exist.

iterator

public java.util.Iterator<TelemetryStream> iterator()
Return an iterator over the TelemetryStreams in this collection.

Specified by:
iterator in interface java.lang.Iterable<TelemetryStream>
Returns:
An iterator over TelemetryStreams.

getTelemetryStreams

public java.util.Collection<TelemetryStream> getTelemetryStreams()
Gets all the telemetry streams contained in this collection.

Returns:
A collection of TelemetryStream object.