/** * Returns the identifier of the Base entity. * * @return The identifier of the Base entity (symbol or name). */ public String getID() { return getBase().getID(); }
/** * Indicates if this factor is dimensionless. A Factor is dimensionless if * and only if the exponent is zero or the Base entity is dimensionless. * * @return <code>true</code> if and only if this Factor is dimensionless. */ public boolean isDimensionless() { return getExponent() == 0 || getBase().isDimensionless(); } }
/** * Indicates if this Factor is the reciprocal of another Factor. * * @param that * The other factor. * @return <code>true</code> if and only if this Factor is the reciprocal of * <code>that</code>. */ public boolean isReciprocalOf(final Factor that) { return getBase().equals(that.getBase()) && getExponent() == -that.getExponent(); }
/** * Indicates if this Factor is the reciprocal of another Factor. * * @param that * The other factor. * @return <code>true</code> if and only if this Factor is the reciprocal of * <code>that</code>. */ public boolean isReciprocalOf(final Factor that) { return getBase().equals(that.getBase()) && getExponent() == -that.getExponent(); }
/** * Indicates if this Factor is semantically identical to another object. * * @param object * The object. * @return <code>true</code> if and only if this Factor is semantically * identical to <code>object< * /code>. */ @Override public boolean equals(final Object object) { boolean equals; if (this == object) { equals = true; } else if (!(object instanceof Factor)) { equals = false; } else { final Factor that = (Factor) object; equals = getExponent() != that.getExponent() ? false : getExponent() == 0 || getBase().equals(that.getBase()); } return equals; }
/** * Indicates if this factor is dimensionless. A Factor is dimensionless if * and only if the exponent is zero or the Base entity is dimensionless. * * @return <code>true</code> if and only if this Factor is dimensionless. */ public boolean isDimensionless() { return getExponent() == 0 || getBase().isDimensionless(); } }
/** * Returns the identifier of the Base entity. * * @return The identifier of the Base entity (symbol or name). */ public String getID() { return getBase().getID(); }
/** * Indicates if this Factor is semantically identical to another object. * * @param object * The object. * @return <code>true</code> if and only if this Factor is semantically * identical to <code>object< * /code>. */ @Override public boolean equals(final Object object) { boolean equals; if (this == object) { equals = true; } else if (!(object instanceof Factor)) { equals = false; } else { final Factor that = (Factor) object; equals = getExponent() != that.getExponent() ? false : getExponent() == 0 || getBase().equals(that.getBase()); } return equals; }