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

org.meeuw.physics.text.spi.UnitsFormatProvider Maven / Gradle / Ivy

Go to download

Contains the structure to associate units and dimensionalAnalysis to (uncertain) numbers. i.e. an object to represent a 'measurement'

There is a newer version: 0.14.0
Show newest version
/*
 *  Copyright 2022 Michiel Meeuwissen
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */
package org.meeuw.physics.text.spi;

import org.meeuw.configuration.Configuration;
import org.meeuw.math.abstractalgebra.AlgebraicElement;
import org.meeuw.math.text.spi.AlgebraicElementFormatProvider;
import org.meeuw.physics.Units;
import org.meeuw.physics.text.UnitsFormat;

/**
 * @author Michiel Meeuwissen
 * @since 0.5
 */
public class UnitsFormatProvider extends AlgebraicElementFormatProvider {

    @Override
    public UnitsFormat getInstance(Configuration configuration) {
        return UnitsFormat.INSTANCE;
    }

    @Override
    public int weight(Class> element) {
        if (Units.class.isAssignableFrom(element)) {
            return 10;
        }
        return -1;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy