## org.ascape.util.data
Class DataGroup

    java.lang.Object
      java.util.Observable
          org.ascape.util.data.DataGroup

All Implemented Interfaces:
  java.io.Serializable

    public class DataGroup

extends java.util.Observable
implements java.io.Serializable

A group of data points and their cooresponding series (pl) of measurements.

Since:
  1.0
Version:
  1.0.2
Author:
  Miles Parker
See Also:
  Serialized Form

Constructor Summary
`DataGroup()`

Method Summary
`void` `add(StatCollector[] addedStatCollectors)` Adds the supplied stats to this group, creating all appropriate data series for them.
`void` `clear()` Clears all data for the group.
`int` `getIndexOfSeries(DataSeries series)` Returns the internal index of the series.
`int` `getIndexOfSeries(java.lang.String name)` Returns the internal index of the series from the series name.
`protected int` `getIndexOfStatCollector(java.lang.String name)` Returns the internal index of the stat from the stat name.
`java.util.Vector` `getPeriods()` Returns a vector of periods for which statistics have been collected.
`Scape` `getScape()` Returns the scape that this data group is primarily related to.
`DataSeries` `getSeries(int index)` Returns the series at the provided index.
`DataSeries` `getSeries(java.lang.String name)` Returns the series with the provided name.
`java.lang.String[]` `getSeriesNames()` Returns the names of every data series in this group.
`int` `getSize()` Returns the total number of data series that comprise this group.
`StatCollector` `getStatCollector(int index)` Returns the stat at the provided index.
`StatCollector` `getStatCollector(java.lang.String name)` Returns the stat with the provided name.
`java.lang.String[]` `getStatCollectorNames()` Returns the names of every statistic in this group.
`StatCollector[]` `getStatCollectors()` Return the stats that comprise this group of data.
`boolean` `isCollectingLongitudinalData()` Returns if this data group's series should be collecting longitudinal data
`boolean` `removeStatCollector(StatCollector toBeRemoved)`
`void` `setCollectingLongitudinalData(boolean collectingLongitudinalData)`
`void` `setScape(Scape scape)` Sets the scape that this data group is primarily related to.
`void` `update()` Called when all data has been collected for a data group for a given period.

Methods inherited from class java.util.Observable
`addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DataGroup

    public DataGroup()

Method Detail

### add

    public void add(StatCollector[] addedStatCollectors)

  Adds the supplied stats to this group, creating all appropriate data series for them. The order and index of existing value stats and data series will be retained.

  Parameters:
    `addedStatCollectors` - the value stat to add to this group Note to Miles: Right now, each StatCollector knows whether or not it is collecting longitudinal data.

### removeStatCollector

    public boolean removeStatCollector(StatCollector toBeRemoved)

### getStatCollectors

    public StatCollector[] getStatCollectors()

  Return the stats that comprise this group of data.

### update

    public void update()

  Called when all data has been collected for a data group for a given period. If scape not null, adds an element to periods for current scape period. Updates data series statistics.

### clear

    public void clear()

  Clears all data for the group. Called when it is time to collect a new set of data. Creates a new blank periods, and clears all data series data and statistics.

### setScape

    public void setScape(Scape scape)

  Sets the scape that this data group is primarily related to.

  Parameters:
    `scape` - the scape this agent is belongs to

### getScape

    public Scape getScape()

  Returns the scape that this data group is primarily related to.

### getPeriods

    public java.util.Vector getPeriods()

  Returns a vector of periods for which statistics have been collected.

### getSize

    public int getSize()

  Returns the total number of data series that comprise this group.

### getIndexOfSeries

    public int getIndexOfSeries(java.lang.String name)

  Returns the internal index of the series from the series name.

  Parameters:
    `name` - the name of the series to get the index for
  Returns:
    the index in this group, -1 if not in this group

### getIndexOfSeries

    public int getIndexOfSeries(DataSeries series)

  Returns the internal index of the series.

  Parameters:
    `series` - the series to get the index for, -1 if not in this group
  Returns:
    the index in this group, -1 if not in this group

### getSeries

    public DataSeries getSeries(int index)

  Returns the series at the provided index.

### getSeries

    public DataSeries getSeries(java.lang.String name)

  Returns the series with the provided name.

### getSeriesNames

    public java.lang.String[] getSeriesNames()

  Returns the names of every data series in this group.

### getIndexOfStatCollector

    protected int getIndexOfStatCollector(java.lang.String name)

  Returns the internal index of the stat from the stat name.

### getStatCollector

    public StatCollector getStatCollector(int index)

  Returns the stat at the provided index.

### getStatCollector

    public StatCollector getStatCollector(java.lang.String name)

  Returns the stat with the provided name. If no such sta exists, returns null.

### getStatCollectorNames

    public java.lang.String[] getStatCollectorNames()

  Returns the names of every statistic in this group.

### isCollectingLongitudinalData

    public boolean isCollectingLongitudinalData()

  Returns if this data group's series should be collecting longitudinal data

### setCollectingLongitudinalData

    public void setCollectingLongitudinalData(boolean collectingLongitudinalData)