|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.units.Factor
public final class Factor
Provides support for a Base/exponent pair. Instances of this class are immutable.
Constructor Summary | |
---|---|
Factor(Base base)
Constructs from a Base. |
|
Factor(Base base,
int exponent)
Constructs from a Base and an exponent. |
|
Factor(Factor factor,
int exponent)
Constructs from a Factor and an exponent. |
Method Summary | |
---|---|
boolean |
equals(Object object)
Indicates if this Factor is semantically identical to another object. |
Base |
getBase()
Returns the Base entity. |
int |
getExponent()
Returns the exponent of the Base entity. |
String |
getID()
Returns the identifier of the Base entity. |
int |
hashCode()
Returns the hash code of this instance. |
boolean |
isDimensionless()
Indicates if this factor is dimensionless. |
boolean |
isReciprocalOf(Factor that)
Indicates if this Factor is the reciprocal of another Factor. |
Factor |
pow(int power)
Raises this Factor to a power. |
String |
toString()
Returns the string representation of this Factor. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Factor(Base base)
base
- The base entity.public Factor(Factor factor, int exponent)
factor
- The factor.exponent
- The exponent.public Factor(Base base, int exponent)
base
- The base entity.exponent
- The exponent.Method Detail |
---|
public Base getBase()
public String getID()
public int getExponent()
public Factor pow(int power)
power
- The power by which to raise this Factor.
public final String toString()
toString
in class Object
public boolean equals(Object object)
equals
in class Object
object
- The object.
true
if and only if this Factor is semantically
identical to object<
/code>.
public int hashCode()
hashCode
in class Object
public boolean isReciprocalOf(Factor that)
that
- The other factor.
true
if and only if this Factor is the reciprocal of
that
.public boolean isDimensionless()
true
if and only if this Factor is dimensionless.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |