org.meeuw.physics.text.spi.PhysicalNumberFormatProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mihxil-physics Show documentation
Show all versions of mihxil-physics Show documentation
Contains the structure to associate units and dimensionalAnalysis to (uncertain) numbers. i.e. an object to represent a 'measurement'
/*
* 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.PhysicalNumber;
import org.meeuw.physics.text.PhysicalNumberFormat;
/**
* @author Michiel Meeuwissen
* @since 0.5
*/
public class PhysicalNumberFormatProvider extends AlgebraicElementFormatProvider {
@Override
public PhysicalNumberFormat getInstance(Configuration configuration) {
PhysicalNumberFormat format = new PhysicalNumberFormat();
return format;
}
@Override
public int weight(Class extends AlgebraicElement>> element) {
if (PhysicalNumber.class.isAssignableFrom(element)) {
return 100;
}
return -1;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy