com.ijchart.xychart.function
Class LineFunction

java.lang.Object
  extended by com.ijchart.xychart.function.LineFunction
All Implemented Interfaces:
IFunction, java.io.Serializable

public class LineFunction
extends java.lang.Object
implements IFunction, java.io.Serializable

Title: IJChart

Description: a chart library for the Java(tm) platform.

A function in the form y = a + bx.

Copyright: Copyright (c) 2013

Company:

Version:
1.0
Author:
zhang feng min,shanghai china. Contract me by email.
See Also:
Serialized Form

Constructor Summary
LineFunction(double a, double b)
           Constructs a new line function.
 
Method Summary
 boolean equals(java.lang.Object obj)
           Override equals method.
 double getA()
           Returns the intercept.
 double getB()
           Returns the slope of the line.
 double getY(double x)
           Calculate the y value for a given inpu x.
 int hashCode()
           Returns a hash code value for the object.
 java.lang.String toString()
           Override toString method.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LineFunction

public LineFunction(double a,
                    double b)
Constructs a new line function.

Parameters:
a - double The intercept.
b - double The slope of the line.
Method Detail

getA

public double getA()
Returns the intercept.

Returns:
double The intercept.

getB

public double getB()
Returns the slope of the line.

Returns:
double The slope of the line.

getY

public double getY(double x)
Calculate the y value for a given inpu x.

Specified by:
getY in interface IFunction
Parameters:
x - double The x value.
Returns:
double The y value.

equals

public boolean equals(java.lang.Object obj)
Override equals method.

Overrides:
equals in class java.lang.Object
Parameters:
obj - Object
Returns:
boolean

toString

public java.lang.String toString()
Override toString method.

Overrides:
toString in class java.lang.Object
Returns:
String

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this object.