fern.tools.gnuplot
Class CollectionAxes

java.lang.Object
  extended by fern.tools.gnuplot.Axes
      extended by fern.tools.gnuplot.CollectionAxes
All Implemented Interfaces:
Iterable<String>

public class CollectionAxes
extends Axes

Implementation of Axes to use with Collections or Iterables of any number type or array of numbers (the type of the collection is inferred by using the reflection api).

Author:
Florian Erhard
See Also:
Axes

Field Summary
 
Fields inherited from class fern.tools.gnuplot.Axes
Additional, ThreeD, TwoD
 
Constructor Summary
CollectionAxes(Collection collection)
          Create a new Axes object containing the given collection without labels /styles.
CollectionAxes(Collection collection, String[] labels, String[] styles)
          Create a new Axes object containing the given collection with the given labels /styles (either can be null).
CollectionAxes(Iterable iterable)
          Create a new Axes object containing a collection (which is copied from the given iterable) without labels /styles.
CollectionAxes(Iterable iterable, String[] labels, String[] styles)
          Create a new Axes object containing a collection (which is copied from the given iterable) with the given labels /styles (either can be null).
 
Method Summary
 int getNumColumns()
          Gets the number of columns.
 int getNumRows()
          Gets the number of rows.
 Iterator<String> iterator()
          Yields the tab separated columns row by row.
 
Methods inherited from class fern.tools.gnuplot.Axes
addAxes, applyDefaultStyle, getDimensionType, getLabel, getNumber, getStyle, getX, setLabel, setStyle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionAxes

public CollectionAxes(Collection collection)
Create a new Axes object containing the given collection without labels /styles.

Parameters:
collection - the collection

CollectionAxes

public CollectionAxes(Iterable iterable)
Create a new Axes object containing a collection (which is copied from the given iterable) without labels /styles.

Parameters:
iterable - the iterable

CollectionAxes

public CollectionAxes(Collection collection,
                      String[] labels,
                      String[] styles)
Create a new Axes object containing the given collection with the given labels /styles (either can be null).

Parameters:
collection - the collection
labels - labels for each column
styles - styles for each column

CollectionAxes

public CollectionAxes(Iterable iterable,
                      String[] labels,
                      String[] styles)
Create a new Axes object containing a collection (which is copied from the given iterable) with the given labels /styles (either can be null).

Parameters:
iterable - the iterable
labels - labels for each column
styles - styles for each column
Method Detail

iterator

public Iterator<String> iterator()
Yields the tab separated columns row by row.


getNumColumns

public int getNumColumns()
Description copied from class: Axes
Gets the number of columns. The number of the attached Axes object is also included.

Specified by:
getNumColumns in class Axes
Returns:
number of columns.

getNumRows

public int getNumRows()
Description copied from class: Axes
Gets the number of rows.

Specified by:
getNumRows in class Axes
Returns:
number of rows.