com.sun.electric.tool.simulation
Class WaveformImpl

java.lang.Object
  extended by com.sun.electric.tool.simulation.WaveformImpl
All Implemented Interfaces:
Waveform
Direct Known Subclasses:
ComplexWaveform

public class WaveformImpl
extends java.lang.Object
implements Waveform

Simple implementation of Waveform interface


Constructor Summary
WaveformImpl(double[] time, double[] value)
          Constructs waveform from time and value arrays.
 
Method Summary
 void getEvent(int index, double[] result)
          Method to return the value of this signal at a given event index.
 int getNumEvents()
          Method to return the number of events in this signal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WaveformImpl

public WaveformImpl(double[] time,
                    double[] value)
Constructs waveform from time and value arrays. They must have the same length.

Parameters:
time - time array
value - value array
Throws:
java.lang.IllegalArgumentException - if time and value arrays have different size
Method Detail

getNumEvents

public int getNumEvents()
Method to return the number of events in this signal. This is the number of events along the horizontal axis, usually "time".

Specified by:
getNumEvents in interface Waveform
Returns:
the number of events in this signal.

getEvent

public void getEvent(int index,
                     double[] result)
Method to return the value of this signal at a given event index.

Specified by:
getEvent in interface Waveform
Parameters:
index - the event index (0-based).
result - double array of length 3 to return (time, lowValue, highValue) If this signal is not a basic signal, return 0 and print an error message.