JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart.data
Class JCDefaultDataInterpreter

java.lang.Object
  |
  +--com.klg.jclass.chart.data.JCDataInterpreter
        |
        +--com.klg.jclass.chart.data.JCDefaultDataInterpreter
All Implemented Interfaces:
Serializable

public class JCDefaultDataInterpreter
extends JCDataInterpreter
implements Serializable

Implements a interpreter for the default chart data format. Relies on input from some reader to populate the specified BaseDataSource class.

Format Information


Array Format Examples: In array format, there is one set of x-axis data, multiple sets of y-axis data. The data may or may not be transposed, for example the two following data files are equivalent:
 ARRAY 2 4  # 2 series (+x-data) w. 4 points each
 1 2 3 4    # x-data
 1 2 3 4    # y1
 1 4 9 16   # y2
 
and
 ARRAY 2 4 T
 1 1 1
 2 2 4
 3 3 9
 4 4 16
 
Or, with names and point labels,
 ARRAY 'My Chart' 2 4
                 'Point Label 1' 'Point Label 2' 'Point Label 3' 'Point Label 4'
 'X Axis Data'    1               2               3               4
 'Y Axis #1 Data' 1               2               3               4
 'Y Axis #2 Data' 1               4               9               16
 
or
 ARRAY 'MyChart' 2 4 T
                'X Data' 'Y Data' 'Y 2 Data'
 'Point Label 1' 1        1        1
 'Point Label 2' 2        2        4
 'Point Label 3' 3        3        9
 'Point Label 4' 4        4        16
 

General format examples: In general format, there are multiple x series.

 # 3 lines, max 5 points each
 GENERAL 3 5
 # line 1, 3 points
 3
 1 3 5    # x-values
 5 14 24  # y-values
 # line 2, 5 points
 5
 1 2 3 4 5
 11 15 18 21 22
 # line 3, 2 points
 2
 2 4
 16 15.2
 
or, using the transposed format
 GENERAL 3 5 T
 # line 1, 3 points
 3
 # X  Y
 1   5
 3  14
 5  24
 # line 2, 5 points
 5
 # X  Y
 1   11
 2   15
 3   18
 4   21
 5   22
 # line 3, 2 points
 2
 # X  Y
 2   16
 4   15.2
 
Or, with point labels and series names
 GENERAL 3 5
 LABELS 'Mercury' 'Venus' 'Earth' 'Mars' 'Jupiter'
 'Series 1' 3
 1 3 5
 5 14 24
 'Series 2' 5
 1 2 3 4 5
 11 15 18 21 22
 'Series 3' 2
 2 4
 16 15.2
 
 GENERAL 3 5 T
 LABELS 'Mercury' 'Venus' 'Earth' 'Mars' 'Jupiter'
 # line 1, 3 points
 'Series 1' 3
 # X  Y
 1   5
 3  14
 5  24
 # line 2, 5 points
 'Series 2' 5
 # X  Y
 1   11
 2   15
 3   18
 4   21
 5   22
 # line 3, 2 points
 'Series 3' 2
 # X  Y
 2   16
 4   15.2
 

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.klg.jclass.chart.data.JCDataInterpreter
baseDS
 
Constructor Summary
JCDefaultDataInterpreter()
          Default no-argument constructor.
JCDefaultDataInterpreter(com.klg.jclass.chart.data.BaseDataSource bds)
          This constructor creates an instance of a data interpreted and associates it with a data source.
 
Method Summary
protected  void ctor(Reader r)
          Parses the specified input stream according to the default chart data format and populates the previously set data source.
 
Methods inherited from class com.klg.jclass.chart.data.JCDataInterpreter
setBaseDataSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JCDefaultDataInterpreter

public JCDefaultDataInterpreter(com.klg.jclass.chart.data.BaseDataSource bds)
This constructor creates an instance of a data interpreted and associates it with a data source. It does not yet do any interpreting.

Parameters:
bds - the data source to eventually be populated with the interpreted data

JCDefaultDataInterpreter

public JCDefaultDataInterpreter()
Default no-argument constructor.

Method Detail

ctor

protected void ctor(Reader r)
             throws IOException
Parses the specified input stream according to the default chart data format and populates the previously set data source. Called by the other ctor() method, and also used for String input where you can't have an input stream.

Specified by:
ctor in class JCDataInterpreter
Parameters:
r - the Reader object used to read data
Throws:
IOException

Copyright © 2004 Quest Software Inc..
All rights reserved.