Coefficientpublic 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 Coefficientpublic void add(Coefficient value)
add in interface Coefficientpublic Coefficient copy()
copy in interface Coefficientpublic int getDenominator()
getDenominator in interface Coefficientpublic int getNumerator()
getNumerator in interface Coefficientpublic double getValue()
getValue in interface Coefficientpublic void multiply(Coefficient value)
multiply in interface Coefficientpublic void divide(Coefficient value)
divide in interface Coefficientprotected void reduce(long newNumerator,
long newDenominator)
public void setDenominator(int value)
setDenominator in interface Coefficientpublic void setNumerator(int value)
setNumerator in interface Coefficientpublic java.lang.String toString()
toString in class java.lang.Object