/** * Returns the factor of the term with specified index. * * @param index the index (starting with 0) * @return the factor of the specified term */ protected BigRational getFactor(int index) { while (factors.size() <= index) { BigRational factor = getCurrentFactor(); factors.add(factor); calculateNextFactor(); } return factors.get(index); }