cox.jmatt.java.MathTools.graphing
Interface Graphable

All Superinterfaces:
Renderable
All Known Implementing Classes:
GraphablePDK, GraphableXML, NOGraphable

public interface Graphable
extends Renderable

This interface represents the actual graph drawn (rendered) onto a sheet of graph paper. The critical concepts here are the expression and its limits. The expression component defines a function, expression, equation, inequality, or other mathematical thing that can be used to generate a graph. The limits define conditions or constraints over which such generation might happen.

Speaking broadly, the expression is evaluated over its limits to generate the graph itself. Exactly how these components interact depends on the actual implementation, but the package is designed around the stated algorithm.

For each of the String constants the value equals the fully-qualified name of the String itself. This is done to allow for easy String conversion when rendering: the toString() value is the name of the constant itself.


Field Summary
static java.lang.String PARAMETRIC_GRAPH
          Use this constant to key a parametric graph.
static java.lang.String PARAMETRIC_X
          This constant is provided as a convenient way to indicate the function X(t) in a parametric equation.
static java.lang.String PARAMETRIC_Y
          This constant is provided as a convenient way to indicate the function Y(t) in a parametric equation.
static java.lang.String POLAR_GRAPH
          Use this constant to key a polar function: r = f(t).
static java.lang.String STANDARD_GRAPH
          This constant can be used to indicate a 'standard' graphable function: y = f(x).
 
Method Summary
 boolean addExpression(java.lang.String pKey, java.lang.Object pExpression)
          Add an expression to the current graph.
 boolean addLimit(java.lang.String pKey, java.lang.Object pLimit)
          Add a limit to the current graph.
 
Methods inherited from interface cox.jmatt.java.MathTools.graphing.Renderable
render, setParameter, setType, testCondition
 

Field Detail

PARAMETRIC_X

static final java.lang.String PARAMETRIC_X
This constant is provided as a convenient way to indicate the function X(t) in a parametric equation.

See Also:
Constant Field Values

PARAMETRIC_Y

static final java.lang.String PARAMETRIC_Y
This constant is provided as a convenient way to indicate the function Y(t) in a parametric equation.

See Also:
Constant Field Values

STANDARD_GRAPH

static final java.lang.String STANDARD_GRAPH
This constant can be used to indicate a 'standard' graphable function: y = f(x).

See Also:
Constant Field Values

POLAR_GRAPH

static final java.lang.String POLAR_GRAPH
Use this constant to key a polar function: r = f(t).

See Also:
Constant Field Values

PARAMETRIC_GRAPH

static final java.lang.String PARAMETRIC_GRAPH
Use this constant to key a parametric graph.

See Also:
Constant Field Values
Method Detail

addExpression

boolean addExpression(java.lang.String pKey,
                      java.lang.Object pExpression)
Add an expression to the current graph. Ordinarily each graph will have only one expression, but parametric functions or piecewise graphs may require more. The pKey is optional but can be used if necessary.

Parameters:
pKey - A String identifying the expression to be added. Usage is optional.
pExpression - The Object representing the graph-generating entity.
Returns:
true if the operation succeeds, false otherwise.

addLimit

boolean addLimit(java.lang.String pKey,
                 java.lang.Object pLimit)
Add a limit to the current graph. This may be in the form of a Constraint or it may be entirely implementation-defined. As with addExpression(), a String key is provided for identification or classification. Usage is optional but strongly suggested!

Parameters:
pKey - A String used to identify the limit being added. Not required.
pLimit - An Object representing the limit to be enforced.
Returns:
true if the limit makes sense and is added successfully, false otherwise.