framed
Class SimulatedFrameSource

java.lang.Object
  extended by framed.SimulatedFrameSource
All Implemented Interfaces:
FrameSource

public class SimulatedFrameSource
extends java.lang.Object
implements FrameSource

Use the SimulatedFrameReader to generate a FrameSource with a predefined sequence of frame values. Usefull for debugging and testing.

Author:
sikoried

Constructor Summary
SimulatedFrameSource(double[][] data)
          Generate a artificial sequence of frames
 
Method Summary
 int getFrameSize()
          Return the length of the frames (needed for the read call)
 boolean read(double[] buf)
          Read the next frame from the data array
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface framed.FrameSource
toString
 

Constructor Detail

SimulatedFrameSource

public SimulatedFrameSource(double[][] data)
Generate a artificial sequence of frames

Parameters:
data -
Method Detail

getFrameSize

public int getFrameSize()
Description copied from interface: FrameSource
Return the length of the frames (needed for the read call)

Specified by:
getFrameSize in interface FrameSource

read

public boolean read(double[] buf)
             throws java.io.IOException
Read the next frame from the data array

Specified by:
read in interface FrameSource
Parameters:
buf - buffer to save the frame; implementing objects may depend on a constant dimensionduring subsequent calls
Returns:
true on success, false if the stream terminated before the window was filled
Throws:
java.io.IOException