Coefficient
public class CoefficientImpl extends java.lang.Object implements Coefficient
Modifier | Constructor | Description |
---|---|---|
|
CoefficientImpl(int value) |
|
|
CoefficientImpl(int numerator,
int denominator) |
|
protected |
CoefficientImpl(int numerator,
int denominator,
double dValue) |
Modifier and Type | Method | Description |
---|---|---|
void |
add(Coefficient value) |
|
Coefficient |
copy() |
|
void |
divide(Coefficient value) |
|
int |
getDenominator() |
|
int |
getNumerator() |
|
double |
getValue() |
|
boolean |
hasOverflow() |
|
void |
multiply(Coefficient value) |
|
protected void |
reduce(long newNumerator,
long newDenominator) |
|
void |
setDenominator(int value) |
|
void |
setNumerator(int value) |
|
java.lang.String |
toString() |
public CoefficientImpl(int value)
public CoefficientImpl(int numerator, int denominator)
protected CoefficientImpl(int numerator, int denominator, double dValue)
public boolean hasOverflow()
hasOverflow
in interface Coefficient
public void add(Coefficient value)
add
in interface Coefficient
public Coefficient copy()
copy
in interface Coefficient
public int getDenominator()
getDenominator
in interface Coefficient
public int getNumerator()
getNumerator
in interface Coefficient
public double getValue()
getValue
in interface Coefficient
public void multiply(Coefficient value)
multiply
in interface Coefficient
public void divide(Coefficient value)
divide
in interface Coefficient
protected void reduce(long newNumerator, long newDenominator)
public void setDenominator(int value)
setDenominator
in interface Coefficient
public void setNumerator(int value)
setNumerator
in interface Coefficient
public java.lang.String toString()
toString
in class java.lang.Object