blob: f05340dad0b9dd6b85f8841353c0cadf8518c059 [file] [log] [blame]
/**
*
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*/
package org.eclipse.osbp.xtext.functionlibrary.common.uomo;
import java.util.Set;
import org.eclipse.uomo.units.impl.BaseAmount;
import org.unitsofmeasurement.quantity.Quantity;
import org.unitsofmeasurement.unit.SystemOfUnits;
import org.unitsofmeasurement.unit.Unit;
/**
* Interface for all system of units for one combination of SystemOfUnits <code><S></code> and Quantity <code><Q></code>
* @param <code><S></code>
* @param <code><Q></code>
*/
public interface ISystemOfQuantityUnits<S extends SystemOfUnits, Q extends Quantity<Q>> {
/**
* @return all units available for this combination of SystemOfUnits and Quantity
*/
public Set<Unit<?>> getUnits();
/**
* @return the name for for this combination of SystemOfUnits and Quantity
*/
public String getName();
/**
* @param systemOfUnitsOrQuantity class of SystemOfUnits or Quantity
* @return true if this system of units handles the given SystemOfUnit or Quantity class
*/
public boolean handles(Class<?> systemOfUnitsOrQuantity);
/**
* @return returns the corresponding basic SystemOfUnits class
*/
public Class<S> getSystemOfUnitsClass();
/**
* @return returns the corresponding basic SystemOfUnits class
*/
public Class<Q> getQuantityClass();
/**
* @return returns the corresponding basic SystemOfUnits class
*/
public Class<BaseAmount<Q>> getAmountClass();
/**
* @param number
* @param unit
* @return returns a unit based amount
*/
public BaseAmount<Q> createAmount(Number number, Unit<Q> unit);
}