net.talvi.puffinplot.data
Class Datum.Reader

java.lang.Object
  extended by net.talvi.puffinplot.data.Datum.Reader
Enclosing class:
Datum

public static class Datum.Reader
extends java.lang.Object

This class allows datum objects to be created from string representations of a specified format. The headers (corresponding to field names) are specified in the constructor, and data lines with a format corresponding to the supplied headers can then be turned into datum objects.


Constructor Summary
Datum.Reader(java.util.List<java.lang.String> headers)
          Create a new reader using the supplied header strings.
 
Method Summary
 Datum fromStrings(java.util.List<java.lang.String> strings)
          Creates a a datum object using the supplied strings to populate the data fields.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Datum.Reader

public Datum.Reader(java.util.List<java.lang.String> headers)
Create a new reader using the supplied header strings. Each header string should correspond to the string representation of a DatumField field.

Parameters:
headers - list of headers defining the data format
Method Detail

fromStrings

public Datum fromStrings(java.util.List<java.lang.String> strings)
Creates a a datum object using the supplied strings to populate the data fields. The values in the supplied list of strings must occur in the same order as the corresponding DatumFields supplied to the reader's constructor.

Parameters:
strings - string representations of data values
Returns:
a datum object containing the supplied values