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.

直线函数,形式为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)
          根据截距和斜率构造直线.
 
Method Summary
 boolean equals(java.lang.Object obj)
          覆盖equals方法.
 double getA()
          返回截距.
 double getB()
          返回斜率.
 double getY(double x)
          根据x值计算y值.
 int hashCode()
          计算hashcode值.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LineFunction

public LineFunction(double a,
                    double b)
根据截距和斜率构造直线.

Parameters:
a - double 截距.
b - double 斜率.
Method Detail

getA

public double getA()
返回截距.

Returns:
double 截距.

getB

public double getB()
返回斜率.

Returns:
double 斜率.

getY

public double getY(double x)
根据x值计算y值.

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

equals

public boolean equals(java.lang.Object obj)
覆盖equals方法.

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

toString

public java.lang.String toString()
覆盖toString()方法.

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

hashCode

public int hashCode()
计算hashcode值.

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