All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jDisco.Table

java.lang.Object
   |
   +----jDisco.Table

public class Table
extends java.lang.Object
This class facilitates table-lookup.

A Table-object represents a function table. An entry (x,y) is added to the table by calling add(x,y). The entries may be added in arbitrary order. The x-es must be distinct, but need not be uniformly spaced.

A call value(x) returns the -value corresponding to x using linear interpolation. If x is less than the minimum x-value of the table, xMin, then value(x) = value(xMin).

If x is greater than the maximum x-value of the table, xMax, then value(x) = value(xMax).


Constructor Index

 o Table()

Method Index

 o add(double)
Adds the entry (time(), y) to the table.
 o add(double, double)
Adds the entry (x, y) to the table.
 o add(Variable)
Adds the entry (time(), v.state) to the table.
 o add(Variable, Variable)
Adds the entry (v1.state, v2.state) to the table.
 o print()
Prints the table without heading.
 o print(String)
Prints the table with a heading.
 o show()
Shows the table as an untitled graph.
 o show(String)
Shows the table as a graph.
 o value(double)
Returns the y-value corresponding to x using linear interpolation.

Constructors

 o Table
 public Table()

Methods

 o add
 public void add(double x,
                 double y)
Adds the entry (x, y) to the table.

Parameters:
x - the x-value.
y - the y-value.
 o add
 public void add(double y)
Adds the entry (time(), y) to the table.

Parameters:
y - the y-value.
 o add
 public void add(jDisco.Variable v)
Adds the entry (time(), v.state) to the table.

Parameters:
v - the Variable-object.
 o add
 public void add(jDisco.Variable v1,
                 jDisco.Variable v2)
Adds the entry (v1.state, v2.state) to the table.

Parameters:
v1 - the first Variable-object.
v2 - the second Variable-object.
 o value
 public double value(double x)
Returns the y-value corresponding to x using linear interpolation.

 o print
 public void print(java.lang.String heading)
Prints the table with a heading.

Parameters:
heading - the heading to be printed above the table.
 o print
 public void print()
Prints the table without heading.

 o show
 public void show(java.lang.String title)
Shows the table as a graph.

Parameters:
title - the title of the graph
 o show
 public void show()
Shows the table as an untitled graph.


All Packages  Class Hierarchy  This Package  Previous  Next  Index