/** * Returns a new {@code Unit} that is the multiplication of this * {@code Unit} and the {@code Unit} specified * * @param that the {@code Unit} that will be multiplied with this * {@code Unit} * * @return a new {@code Unit} that is the multiplication of this * {@code Unit} and the {@code Unit} specified * * @throws RuntimeException if both {@code Unit} s are special * * @see Unit#isSpecial() */ Unit mul(Unit that) { if (this.isSpecial() && that.isSpecial()) { throw new ArithmeticException("Cannot multiply " + this + " with " + that); } return find(this.type - UNITY + that.type); }
/** * Returns a new {@code Unit} that is the division of this {@code Unit} and * the {@code Unit} specified * * @param that the {@code Unit} that this {@code Unit} will be divided with * @return a new {@code Unit} that is the division of this {@code Unit} and * the {@code Unit} specified * * @throws RuntimeException if both {@code Unit} s are special * * @see Unit#isSpecial() */ Unit div(Unit that) { if (this.isSpecial() && that.isSpecial()) { if (this.type == that.type) { return Unit.unity; } throw new ArithmeticException("Cannot divide " + this + " by " + that); } return find(this.type - that.type + UNITY); }
/** * Returns a new <code>Unit</code> that is the multiplication of this * <code>Unit</code> and the <code>Unit</code> specified * * @param that the <code>Unit</code> that will be multiplied with this * <code>Unit</code> * * @return a new <code>Unit</code> that is the multiplication of this * <code>Unit</code> and the <code>Unit</code> specified * * @throws RuntimeException if both <code>Unit</code> s are special * * @see Unit#isSpecial */ Unit mul(Unit that) { if (this.isSpecial() && that.isSpecial()) { throw new ArithmeticException("Cannot multiply " + this + " with " + that); } return find(this.type - UNITY + that.type); }
/** * Returns a new <code>Unit</code> that is the division of this <code>Unit</code> * and the <code>Unit</code> specified * * @param that the <code>Unit</code> that this <code>Unit</code> will be divided * with * @return a new <code>Unit</code> that is the division of this <code>Unit</code> * and the <code>Unit</code> specified * * @throws RuntimeException if both <code>Unit</code> s are special * * @see Unit#isSpecial */ Unit div(Unit that) { if (this.isSpecial() && that.isSpecial()) { if (this.type == that.type) { return Unit.unity; } throw new ArithmeticException("Cannot divide " + this + " by " + that); } return find(this.type - that.type + UNITY); }
/** * Returns a new {@code Unit} that is the division of this {@code Unit} and * the {@code Unit} specified * * @param that the {@code Unit} that this {@code Unit} will be divided with * @return a new {@code Unit} that is the division of this {@code Unit} and * the {@code Unit} specified * * @throws RuntimeException if both {@code Unit} s are special * * @see Unit#isSpecial() */ Unit div(Unit that) { if (this.isSpecial() && that.isSpecial()) { if (this.type == that.type) { return Unit.unity; } throw new ArithmeticException("Cannot divide " + this + " by " + that); } return find(this.type - that.type + UNITY); }
/** * Returns a new {@code Unit} that is the multiplication of this * {@code Unit} and the {@code Unit} specified * * @param that the {@code Unit} that will be multiplied with this * {@code Unit} * * @return a new {@code Unit} that is the multiplication of this * {@code Unit} and the {@code Unit} specified * * @throws RuntimeException if both {@code Unit} s are special * * @see Unit#isSpecial() */ Unit mul(Unit that) { if (this.isSpecial() && that.isSpecial()) { throw new ArithmeticException("Cannot multiply " + this + " with " + that); } return find(this.type - UNITY + that.type); }
/** * Returns a new {@code Unit} that is the multiplication of this * {@code Unit} and the {@code Unit} specified * * @param that the {@code Unit} that will be multiplied with this * {@code Unit} * * @return a new {@code Unit} that is the multiplication of this * {@code Unit} and the {@code Unit} specified * * @throws RuntimeException if both {@code Unit} s are special * * @see Unit#isSpecial() */ Unit mul(Unit that) { if (this.isSpecial() && that.isSpecial()) { throw new ArithmeticException("Cannot multiply " + this + " with " + that); } return find(this.type - UNITY + that.type); }
/** * Returns a new {@code Unit} that is the multiplication of this * {@code Unit} and the {@code Unit} specified * * @param that the {@code Unit} that will be multiplied with this * {@code Unit} * * @return a new {@code Unit} that is the multiplication of this * {@code Unit} and the {@code Unit} specified * * @throws RuntimeException if both {@code Unit} s are special * * @see Unit#isSpecial() */ Unit mul(Unit that) { if (this.isSpecial() && that.isSpecial()) { throw new ArithmeticException("Cannot multiply " + this + " with " + that); } return find(this.type - UNITY + that.type); }
/** * Returns a new {@code Unit} that is the multiplication of this * {@code Unit} and the {@code Unit} specified * * @param that the {@code Unit} that will be multiplied with this * {@code Unit} * * @return a new {@code Unit} that is the multiplication of this * {@code Unit} and the {@code Unit} specified * * @throws RuntimeException if both {@code Unit} s are special * * @see Unit#isSpecial() */ Unit mul(Unit that) { if (this.isSpecial() && that.isSpecial()) { throw new ArithmeticException("Cannot multiply " + this + " with " + that); } return find(this.type - UNITY + that.type); }
/** * Returns a new {@code Unit} that is the multiplication of this * {@code Unit} and the {@code Unit} specified * * @param that the {@code Unit} that will be multiplied with this * {@code Unit} * * @return a new {@code Unit} that is the multiplication of this * {@code Unit} and the {@code Unit} specified * * @throws RuntimeException if both {@code Unit} s are special * * @see Unit#isSpecial() */ Unit mul(Unit that) { if (this.isSpecial() && that.isSpecial()) { throw new ArithmeticException("Cannot multiply " + this + " with " + that); } return find(this.type - UNITY + that.type); }
/** * Returns a new {@code Unit} that is the division of this {@code Unit} and * the {@code Unit} specified * * @param that the {@code Unit} that this {@code Unit} will be divided with * @return a new {@code Unit} that is the division of this {@code Unit} and * the {@code Unit} specified * * @throws RuntimeException if both {@code Unit} s are special * * @see Unit#isSpecial() */ Unit div(Unit that) { if (this.isSpecial() && that.isSpecial()) { if (this.type == that.type) { return Unit.unity; } throw new ArithmeticException("Cannot divide " + this + " by " + that); } return find(this.type - that.type + UNITY); }
/** * Returns a new {@code Unit} that is the division of this {@code Unit} and * the {@code Unit} specified * * @param that the {@code Unit} that this {@code Unit} will be divided with * @return a new {@code Unit} that is the division of this {@code Unit} and * the {@code Unit} specified * * @throws RuntimeException if both {@code Unit} s are special * * @see Unit#isSpecial() */ Unit div(Unit that) { if (this.isSpecial() && that.isSpecial()) { if (this.type == that.type) { return Unit.unity; } throw new ArithmeticException("Cannot divide " + this + " by " + that); } return find(this.type - that.type + UNITY); }
/** * Returns a new {@code Unit} that is the division of this {@code Unit} and * the {@code Unit} specified * * @param that the {@code Unit} that this {@code Unit} will be divided with * @return a new {@code Unit} that is the division of this {@code Unit} and * the {@code Unit} specified * * @throws RuntimeException if both {@code Unit} s are special * * @see Unit#isSpecial() */ Unit div(Unit that) { if (this.isSpecial() && that.isSpecial()) { if (this.type == that.type) { return Unit.unity; } throw new ArithmeticException("Cannot divide " + this + " by " + that); } return find(this.type - that.type + UNITY); }
/** * Returns a new {@code Unit} that is the multiplication of this * {@code Unit} and the {@code Unit} specified * * @param that the {@code Unit} that will be multiplied with this * {@code Unit} * * @return a new {@code Unit} that is the multiplication of this * {@code Unit} and the {@code Unit} specified * * @throws RuntimeException if both {@code Unit} s are special * * @see Unit#isSpecial() */ Unit mul(Unit that) { if (this.isSpecial() && that.isSpecial()) { throw new ArithmeticException("Cannot multiply " + this + " with " + that); } return find(this.type - UNITY + that.type); }
/** * Returns a new {@code Unit} that is the division of this {@code Unit} and * the {@code Unit} specified * * @param that the {@code Unit} that this {@code Unit} will be divided with * @return a new {@code Unit} that is the division of this {@code Unit} and * the {@code Unit} specified * * @throws RuntimeException if both {@code Unit} s are special * * @see Unit#isSpecial() */ Unit div(Unit that) { if (this.isSpecial() && that.isSpecial()) { if (this.type == that.type) { return Unit.unity; } throw new ArithmeticException("Cannot divide " + this + " by " + that); } return find(this.type - that.type + UNITY); }
/** * Returns a new {@code Unit} that is the multiplication of this * {@code Unit} and the {@code Unit} specified * * @param that the {@code Unit} that will be multiplied with this * {@code Unit} * * @return a new {@code Unit} that is the multiplication of this * {@code Unit} and the {@code Unit} specified * * @throws RuntimeException if both {@code Unit} s are special * * @see Unit#isSpecial() */ Unit mul(Unit that) { if (this.isSpecial() && that.isSpecial()) { throw new ArithmeticException("Cannot multiply " + this + " with " + that); } return find(this.type - UNITY + that.type); }
/** * Returns a new {@code Unit} that is the division of this {@code Unit} and * the {@code Unit} specified * * @param that the {@code Unit} that this {@code Unit} will be divided with * @return a new {@code Unit} that is the division of this {@code Unit} and * the {@code Unit} specified * * @throws RuntimeException if both {@code Unit} s are special * * @see Unit#isSpecial() */ Unit div(Unit that) { if (this.isSpecial() && that.isSpecial()) { if (this.type == that.type) { return Unit.unity; } throw new ArithmeticException("Cannot divide " + this + " by " + that); } return find(this.type - that.type + UNITY); }
/** * Returns a new {@code Unit} that is the division of this {@code Unit} and * the {@code Unit} specified * * @param that the {@code Unit} that this {@code Unit} will be divided with * @return a new {@code Unit} that is the division of this {@code Unit} and * the {@code Unit} specified * * @throws RuntimeException if both {@code Unit} s are special * * @see Unit#isSpecial() */ Unit div(Unit that) { if (this.isSpecial() && that.isSpecial()) { if (this.type == that.type) { return Unit.unity; } throw new ArithmeticException("Cannot divide " + this + " by " + that); } return find(this.type - that.type + UNITY); }