All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jscl.MathContext Maven / Gradle / Ivy

package jscl;

import jscl.math.function.Function;
import jscl.math.function.IConstant;
import jscl.math.operator.Operator;
import javax.annotation.Nonnull;
import org.solovyev.common.math.MathRegistry;

import java.text.DecimalFormatSymbols;

/**
 * User: serso
 * Date: 11/29/11
 * Time: 11:33 AM
 */
public interface MathContext {

    @Nonnull
    MathRegistry getFunctionsRegistry();

    @Nonnull
    MathRegistry getOperatorsRegistry();

    @Nonnull
    MathRegistry getConstantsRegistry();

    @Nonnull
    MathRegistry getPostfixFunctionsRegistry();

    @Nonnull
    AngleUnit getAngleUnits();

    void setAngleUnits(@Nonnull AngleUnit defaultAngleUnits);

    @Nonnull
    NumeralBase getNumeralBase();


    // OUTPUT NUMBER FORMATTING
    // todo serso: maybe gather all formatting data in one object?

    void setNumeralBase(@Nonnull NumeralBase numeralBase);

    void setDecimalGroupSymbols(@Nonnull DecimalFormatSymbols decimalGroupSymbols);

    void setRoundResult(boolean roundResult);

    void setPrecision(int precision);

    void setUseGroupingSeparator(boolean useGroupingSeparator);

    void setGroupingSeparator(char groupingSeparator);

    @Nonnull
    String format(@Nonnull Double value) throws NumeralBaseException;

    @Nonnull
    String format(@Nonnull Double value, @Nonnull NumeralBase nb) throws NumeralBaseException;

    @Nonnull
    String addGroupingSeparators(@Nonnull NumeralBase nb, @Nonnull String ungroupedIntValue);

    void setScienceNotation(boolean scienceNotation);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy