JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart.data
Class JCInputStreamDataSource

java.lang.Object
  |
  +--com.klg.jclass.chart.ChartDataSupport
        |
        +--com.klg.jclass.chart.data.BaseDataSource
              |
              +--com.klg.jclass.chart.data.JCInputStreamDataSource
All Implemented Interfaces:
ChartDataManageable, ChartDataManager, ChartDataModel, HoleValueChartDataModel, com.klg.jclass.chart.ImageMapChartDataModel, LabelledChartDataModel, Serializable
Direct Known Subclasses:
JCAppletDataSource, JCFileDataSource, JCReaderDataSource, JCStringDataSource, JCURLDataSource

public class JCInputStreamDataSource
extends BaseDataSource

This class is the base for any data source that relies on input from some stream, which includes files, urls, large Strings, etc. Data is interpreted according by a interpreter classes that subclasses from JCDataInterpreter.

See Also:
Serialized Form

Field Summary
protected  String charsetName
          The name of a supported charset
protected  com.klg.jclass.chart.data.JCDataInterpreter interpreter
          Interpreter being used to interpret data.
 
Fields inherited from class com.klg.jclass.chart.data.BaseDataSource
cloneArrays, clusterImageMapInfo, holeValue, legendImageMapInfo, name, pointImageMapInfo, pointLabels, seriesImageMapInfo, seriesLabels, xvalues, yvalues
 
Fields inherited from class com.klg.jclass.chart.ChartDataSupport
source
 
Fields inherited from interface com.klg.jclass.chart.ChartDataModel
ALL
 
Constructor Summary
protected JCInputStreamDataSource()
          This constructor sets up a JCInputStreamDataSource class to use the default interpreter.
  JCInputStreamDataSource(InputStream i)
          This constructor takes the InputStream, reads in all the appropriate data and interprets it according to the default interpreter class.
  JCInputStreamDataSource(InputStream i, com.klg.jclass.chart.data.JCDataInterpreter p)
          This constructor takes the InputStream, reads in all the appropriate data, and interprets it according to the specified interpreter class.
  JCInputStreamDataSource(InputStream i, com.klg.jclass.chart.data.JCDataInterpreter p, String charsetName)
          This constructor takes the InputStream, reads in all the appropriate data based on the given charset, and interprets it according to the specified interpreter class.
protected JCInputStreamDataSource(com.klg.jclass.chart.data.JCDataInterpreter p)
          This constructor sets up a JCInputStreamDataSource class to use the specified interpreter.
protected JCInputStreamDataSource(com.klg.jclass.chart.data.JCDataInterpreter p, String charsetName)
          This constructor sets up a JCInputStreamDataSource class to use the specified interpreter and charset.
 
Method Summary
protected  void ctor(InputStream i)
          Parses the specified input stream and populates this data source.
protected  void ctor(Reader r)
          Version of ctor() that takes a Reader.
 String getCharsetName()
          Gets the name of the charset
 com.klg.jclass.chart.data.JCDataInterpreter getInterpreter()
          Gets the interpreter
 void setCharsetName(String charsetName)
          Sets the name of the charset
 void setInterpreter(com.klg.jclass.chart.data.JCDataInterpreter interpreter)
          Sets the interpreter
 
Methods inherited from class com.klg.jclass.chart.data.BaseDataSource
cloneCheck, cloneCheck, cloneCheck, getChartDataManager, getCloneArrays, getClusterImageMapInfo, getDataSourceName, getHoleValue, getLegendImageMapInfo, getNumSeries, getPointImageMapInfo, getPointLabels, getSeriesImageMapInfo, getSeriesLabels, getXSeries, getYSeries, setCloneArrays
 
Methods inherited from class com.klg.jclass.chart.ChartDataSupport
addChartDataListener, fireChartDataEvent, fireChartDataEvent, removeChartDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

interpreter

protected com.klg.jclass.chart.data.JCDataInterpreter interpreter
Interpreter being used to interpret data.


charsetName

protected String charsetName
The name of a supported charset

Constructor Detail

JCInputStreamDataSource

public JCInputStreamDataSource(InputStream i)
                        throws IOException
This constructor takes the InputStream, reads in all the appropriate data and interprets it according to the default interpreter class.

Parameters:
i - InputStream object used to read the data
Throws:
IOException - An IOException will be thrown if there are any errors while reading in the data.

JCInputStreamDataSource

public JCInputStreamDataSource(InputStream i,
                               com.klg.jclass.chart.data.JCDataInterpreter p)
                        throws IOException
This constructor takes the InputStream, reads in all the appropriate data, and interprets it according to the specified interpreter class.

Parameters:
i - InputStream object used to read the data
p - Interpreter used to make sense of the data
Throws:
IOException - An IOException will be thrown if there are any errors while reading in the data.

JCInputStreamDataSource

public JCInputStreamDataSource(InputStream i,
                               com.klg.jclass.chart.data.JCDataInterpreter p,
                               String charsetName)
                        throws IOException
This constructor takes the InputStream, reads in all the appropriate data based on the given charset, and interprets it according to the specified interpreter class.

Parameters:
i - InputStream object used to read the data
p - Interpreter used to make sense of the data
charsetName - The name of a supported charset
Throws:
IOException - An IOException will be thrown if there are any errors while reading in the data.

JCInputStreamDataSource

protected JCInputStreamDataSource()
                           throws IOException
This constructor sets up a JCInputStreamDataSource class to use the default interpreter. It does not yet read or interpret any data.

Throws:
IOException - An IOException will be thrown if there are any errors while reading in the data.

JCInputStreamDataSource

protected JCInputStreamDataSource(com.klg.jclass.chart.data.JCDataInterpreter p)
                           throws IOException
This constructor sets up a JCInputStreamDataSource class to use the specified interpreter. It does not yet read or interpret any data.

Parameters:
p - the data interpreter to be used
Throws:
IOException - An IOException will be thrown if there are any errors while reading in the data.

JCInputStreamDataSource

protected JCInputStreamDataSource(com.klg.jclass.chart.data.JCDataInterpreter p,
                                  String charsetName)
                           throws IOException
This constructor sets up a JCInputStreamDataSource class to use the specified interpreter and charset. It does not yet read or interpret any data.

Parameters:
p - the data interpreter to be used
charsetName - The name of a supported charset
Throws:
IOException - An IOException will be thrown if there are any errors while reading in the data.
Method Detail

getInterpreter

public com.klg.jclass.chart.data.JCDataInterpreter getInterpreter()
Gets the interpreter

Returns:
The current interpreter

setInterpreter

public void setInterpreter(com.klg.jclass.chart.data.JCDataInterpreter interpreter)
Sets the interpreter

Parameters:
interpreter - The new interpreter

getCharsetName

public String getCharsetName()
Gets the name of the charset

Returns:
The name of the current charset

setCharsetName

public void setCharsetName(String charsetName)
Sets the name of the charset

Parameters:
charsetName - The name of a supported charset

ctor

protected void ctor(InputStream i)
             throws IOException
Parses the specified input stream and populates this data source. Provided because subclasses may need to set the stream up before they can call super() (for example, AppletDataSource).

Parameters:
i - the InputStream object to read data from
Throws:
IOException - An IOException will be thrown if there are any errors while reading in the data.

ctor

protected void ctor(Reader r)
             throws IOException
Version of ctor() that takes a Reader. Called by the other ctor() and for String input where you can't have an input stream. If no interpreter has been set, it determines the appropriate interpreter to use from the data in the reader.

Parameters:
r - the Reader object to read data from
Throws:
IOException - An IOException will be thrown if there are any errors while reading in the data.

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