com.sun.faban.driver.util
Class PlotServer

java.lang.Object
  extended by com.sun.faban.driver.util.PlotServer

public class PlotServer
extends Object

The PlotServer is the server side implementation to feed data to all StreamChart clients that try to connect to it.

Author:
Akara Sucharitakul

Constructor Summary
PlotServer(int numSeries, String target)
          Constructs a PlotServer listening to a particular TCP port and having a buffer for sending certain number of values at a time.
 
Method Summary
 int numChannels()
          Obtains the number of channels currently writing to.
 void plot(double value)
          Sends a single y value to the graph to plot.
 void plot(double[] values)
          Sends a number of y values to the graph to plot.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlotServer

public PlotServer(int numSeries,
                  String target)
           throws IOException
Constructs a PlotServer listening to a particular TCP port and having a buffer for sending certain number of values at a time.

Parameters:
numSeries - The number of data values to send and plot
target - The port number or file to write to
Throws:
IOException - Cannot listen to port
Method Detail

numChannels

public int numChannels()
Obtains the number of channels currently writing to.

Returns:
The number of open channels

plot

public void plot(double[] values)
          throws IOException
Sends a number of y values to the graph to plot.

Parameters:
values - The y values to plot
Throws:
IOException - if the data cannot be written

plot

public void plot(double value)
          throws IOException
Sends a single y value to the graph to plot.

Parameters:
value - The y value to plot
Throws:
IOException - if the data cannot be written