anl.aida.bubble
Class DefaultBubbleDataset

java.lang.Object
  extended by anl.aida.bubble.DefaultBubbleDataset
All Implemented Interfaces:
BubbleDataset

public class DefaultBubbleDataset
extends java.lang.Object
implements BubbleDataset

Default implementation of a BubbleDataset that adapts DataFrames to the BubbleDataset interface.


Nested Class Summary
private static class DefaultBubbleDataset.CategoryEntry
           
private  class DefaultBubbleDataset.CategoryIter
           
 
Field Summary
private  java.util.Calendar cal
           
private static int CALENDAR_FIELD
           
private  java.util.List<DefaultBubbleDataset.CategoryEntry> categories
           
private  int[] offsets
           
private  int tsCount
           
private  anl.aida.data.DataFrame xFrame
           
private  NumericRange xRange
           
private  anl.aida.data.DataFrame yFrame
           
private  NumericRange yRange
           
private  anl.aida.data.DataFrame zFrame
           
private  NumericRange zRange
           
 
Constructor Summary
DefaultBubbleDataset(anl.aida.data.DataFrame xFrame, anl.aida.data.DataFrame yFrame, anl.aida.data.DataFrame zFrame)
           
DefaultBubbleDataset(anl.aida.data.DataFrame xFrame, anl.aida.data.DataFrame yFrame, anl.aida.data.DataFrame zFrame, int categoryCount)
           
 
Method Summary
 java.lang.Iterable<java.lang.String> categories()
          Gets an iterable over the categories in this dataset.
 int getCategoryCount()
          Gets the number of categories in this dataset.
 int getCategoryIndex(java.lang.String category)
          Gets the index of the specified category.
 java.lang.String getFormattedTimeStep(int timestep)
          Gets the formatted timestep (e.g.
 int getTimeStepCount()
          Gets the number of timesteps.
 NumericRange getXRange()
          Gets the range of x values over all timesteps and categories.
 double getXValue(int categoryIndex, int timestep)
          Gets the x value for the particular category at the specified timestep.
 NumericRange getYRange()
          Gets the range of y values over all timesteps and categories.
 double getYValue(int categoryIndex, int timestep)
          Gets the y value for the particular category at the specified timestep.
 NumericRange getZRange()
          Gets the range of z values over all timesteps and categories.
 double getZValue(int categoryIndex, int timestep)
          Gets the z value for the particular category at the specified timestep.
private  void initRanges()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xFrame

private anl.aida.data.DataFrame xFrame

yFrame

private anl.aida.data.DataFrame yFrame

zFrame

private anl.aida.data.DataFrame zFrame

offsets

private int[] offsets

tsCount

private int tsCount

categories

private java.util.List<DefaultBubbleDataset.CategoryEntry> categories

cal

private java.util.Calendar cal

xRange

private NumericRange xRange

yRange

private NumericRange yRange

zRange

private NumericRange zRange

CALENDAR_FIELD

private static int CALENDAR_FIELD
Constructor Detail

DefaultBubbleDataset

public DefaultBubbleDataset(anl.aida.data.DataFrame xFrame,
                            anl.aida.data.DataFrame yFrame,
                            anl.aida.data.DataFrame zFrame)
Parameters:
xFrame -
yFrame -
zFrame -

DefaultBubbleDataset

public DefaultBubbleDataset(anl.aida.data.DataFrame xFrame,
                            anl.aida.data.DataFrame yFrame,
                            anl.aida.data.DataFrame zFrame,
                            int categoryCount)
Parameters:
xFrame -
yFrame -
zFrame -
categoryCount - the number of categories to display. -1 means show all.
Method Detail

initRanges

private void initRanges()

categories

public java.lang.Iterable<java.lang.String> categories()
Description copied from interface: BubbleDataset
Gets an iterable over the categories in this dataset.

Specified by:
categories in interface BubbleDataset
Returns:
an iterable over the categories in this dataset.

getCategoryIndex

public int getCategoryIndex(java.lang.String category)
Description copied from interface: BubbleDataset
Gets the index of the specified category.

Specified by:
getCategoryIndex in interface BubbleDataset
Parameters:
category - the category whose index we want
Returns:
the index of the specified category.

getFormattedTimeStep

public java.lang.String getFormattedTimeStep(int timestep)
Description copied from interface: BubbleDataset
Gets the formatted timestep (e.g. a formatted date, a year, etc.)

Specified by:
getFormattedTimeStep in interface BubbleDataset
Parameters:
timestep - the formatted timestep
Returns:

getCategoryCount

public int getCategoryCount()
Description copied from interface: BubbleDataset
Gets the number of categories in this dataset.

Specified by:
getCategoryCount in interface BubbleDataset
Returns:
the number of categories in this dataset.

getTimeStepCount

public int getTimeStepCount()
Description copied from interface: BubbleDataset
Gets the number of timesteps.

Specified by:
getTimeStepCount in interface BubbleDataset
Returns:
the number of timesteps.

getXValue

public double getXValue(int categoryIndex,
                        int timestep)
Description copied from interface: BubbleDataset
Gets the x value for the particular category at the specified timestep.

Specified by:
getXValue in interface BubbleDataset
Parameters:
categoryIndex - the category index
timestep - the timestep
Returns:
the x value for the particular category at the specified timestep.

getYValue

public double getYValue(int categoryIndex,
                        int timestep)
Description copied from interface: BubbleDataset
Gets the y value for the particular category at the specified timestep.

Specified by:
getYValue in interface BubbleDataset
Parameters:
categoryIndex - the category index
timestep - the timestep
Returns:
the y value for the particular category at the specified timestep.

getZValue

public double getZValue(int categoryIndex,
                        int timestep)
Description copied from interface: BubbleDataset
Gets the z value for the particular category at the specified timestep.

Specified by:
getZValue in interface BubbleDataset
Parameters:
categoryIndex - the category index
timestep - the timestep
Returns:
the z value for the particular category at the specified timestep.

getXRange

public NumericRange getXRange()
Description copied from interface: BubbleDataset
Gets the range of x values over all timesteps and categories.

Specified by:
getXRange in interface BubbleDataset
Returns:
the range of x values over all timesteps and categories.

getYRange

public NumericRange getYRange()
Description copied from interface: BubbleDataset
Gets the range of y values over all timesteps and categories.

Specified by:
getYRange in interface BubbleDataset
Returns:
the range of y values over all timesteps and categories.

getZRange

public NumericRange getZRange()
Description copied from interface: BubbleDataset
Gets the range of z values over all timesteps and categories.

Specified by:
getZRange in interface BubbleDataset
Returns:
the range of z values over all timesteps and categories.