|
JScience v4.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.mathematics.function.Term
public final class Term
This class represents the term of a polynomial
such as x·y².
| Field Summary | |
|---|---|
static Term |
ONE
Holds the multiplicative identity. |
| Method Summary | |
|---|---|
int |
compareTo(Term that)
Compares this term with the one specified for order. |
Term |
copy()
Returns an entierely new copy of this term allocated
by the calling thread (possibly on the stack). |
Term |
divide(Term that)
Return the division of this term with the one specified. |
boolean |
equals(java.lang.Object obj)
Indicates if this term is equal to the object specified. |
int |
getPower(int index)
Returns the power of the variable at the specified position. |
int |
getPower(Variable<?> v)
Returns the power of the specified variable. |
Variable<?> |
getVariable(int index)
Returns the variable at the specified index (variables are lexically ordered). |
int |
hashCode()
Returns a hash code for this term. |
int |
size()
Returns the number of variables for this term. |
Term |
times(Term that)
Return the product of this term with the one specified. |
java.lang.String |
toString()
Returns the text representation of this term as a java.lang.String. |
javolution.text.Text |
toText()
Returns the text representation of this term. |
static Term |
valueOf(Variable<?> v,
int n)
Return the term corresponding to the specified variable raised to the specified power. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static Term ONE
| Method Detail |
|---|
public static Term valueOf(Variable<?> v,
int n)
v - the variable.n - the power.
vn
java.lang.IllegalArgumentException - if n < 0public int size()
public Variable<?> getVariable(int index)
index - the variable index.
java.lang.IndexOutOfBoundsException - if
(index < 0) || (index >= size())public int getPower(int index)
index - the variable index.
java.lang.IndexOutOfBoundsException - if
(index < 0) || (index >= size())public int getPower(Variable<?> v)
v - the variable for which the power is returned.
0 if
this term does not hold the specified variable.public Term times(Term that)
that - the term multiplier.
this · that
java.lang.IllegalArgumentException - if the specified term holds a
variable having the same symbol as one of the variable of
this term; but both variables are distinct.public Term divide(Term that)
that - the term divisor.
this / that
java.lang.UnsupportedOperationException - if this division would
result in negative power.
java.lang.IllegalArgumentException - if the specified term holds a
variable having the same symbol as one of the variable of
this term; but both variables are distinct.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object to compare for equality.
true if this term and the specified object are
considered equal; false otherwise.public final int hashCode()
hashCode in class java.lang.Objectpublic final java.lang.String toString()
java.lang.String.
toString in class java.lang.ObjecttoText().toString()public javolution.text.Text toText()
toText in interface javolution.lang.Realtimepublic Term copy()
allocated
by the calling thread (possibly on the stack).
copy in interface javolution.lang.ValueTypepublic int compareTo(Term that)
compareTo in interface java.lang.Comparable<Term>that - the term to be compared to.
|
JScience v4.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||