|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsbrt.kernel.math.AbstractLinearComb.Term<V>
V
- the variable type.public abstract static class AbstractLinearComb.Term<V>
This class is a skeleton implementation of LinearComb.Term.
Constructor Summary | |
---|---|
AbstractLinearComb.Term(double coefficient,
V variable)
Constructs a new linear combination term with the provided coefficient and variable. |
|
AbstractLinearComb.Term(V variable)
Constructs a new linear combination term with the provided variable. |
|
AbstractLinearComb.Term(V variable,
double coefficient)
Constructs a new linear combination term with the provided coefficient and variable. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Indicates if the provided object is equal to this term. |
double |
getCoefficient()
Returns the coefficient of this term. |
V |
getVariable()
Returns the variable contained in this term. |
java.util.Set<V> |
getVariables()
Returns the set of variables contained in this term. |
boolean |
hasAllVariables(java.util.Collection<?> variables)
Indicates if this term contains all of the variables in the provided collection. |
int |
hashCode()
Returns a content-based hash code for this term. |
boolean |
hasVariable(java.lang.Object variable)
Indicates if the provided object is a variable contained in this term. |
boolean |
hasVariables()
Returns true . |
java.util.Iterator<V> |
iterator()
Returns an iterator over the variables in this term. |
int |
power(java.lang.Object variable)
Returns the power of the provided variable in this term. |
java.lang.String |
toString()
Returns an appropriate string representation of this term. |
int |
variables()
Returns 1 . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractLinearComb.Term(double coefficient, V variable)
coefficient
- the coefficient of this term.variable
- the variable of this term.public AbstractLinearComb.Term(V variable, double coefficient)
variable
- the variable of this term.coefficient
- the coefficient of this term.public AbstractLinearComb.Term(V variable)
variable
- the variable of this term.Method Detail |
---|
public V getVariable()
getVariable
in interface LinearComb.Term<V>
public double getCoefficient()
getCoefficient
in interface Polynomial.Term<V>
public boolean equals(java.lang.Object obj)
Two terms are considered equal if they contain the same coefficient and variable.
equals
in interface Polynomial.Term<V>
equals
in class java.lang.Object
obj
- the object to be tested for equality with
this term.
true
if this term is equal to the provided object;
false
otherwise.public int hashCode()
hashCode
in interface Polynomial.Term<V>
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in interface Polynomial.Term<V>
toString
in class java.lang.Object
public java.util.Iterator<V> iterator()
iterator
in interface java.lang.Iterable<V>
iterator
in interface Polynomial.Term<V>
public int power(java.lang.Object variable)
power
in interface Polynomial.Term<V>
variable
- the variable whose power is to be
returned.
public java.util.Set<V> getVariables()
getVariables
in interface Polynomial.Term<V>
public boolean hasAllVariables(java.util.Collection<?> variables)
hasAllVariables
in interface Polynomial.Term<V>
variables
- the collection of variables whose
presence in this term is to be tested.
true
if each element of the provided
collection is a variable in this term;
false
otherwise.public boolean hasVariable(java.lang.Object variable)
hasVariable
in interface Polynomial.Term<V>
variable
- the variable whose presence in this
term is to be tested.
true
if this term contains the
provided variable; false
otherwise.public boolean hasVariables()
true
.
true
.public int variables()
1
.
variables
in interface Polynomial.Term<V>
1
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |