| /** |
| * |
| * 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 v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * 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); |
| } |