public class SICoefficients extends Object
Copyright (c) 2015-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
$LastChangedDate: 2019-01-18 00:35:01 +0100 (Fri, 18 Jan 2019) $, @version $Revision: 324 $, by $Author: averbraeck $,
initial version Jun 15, 2014
Modifier | Constructor and Description |
---|---|
protected |
SICoefficients(EnumMap<SI,Integer> coefficients)
Construct an instance of SICoefficients.
|
Modifier and Type | Method and Description |
---|---|
static SICoefficients |
divide(SICoefficients a,
SICoefficients b) |
protected static String |
enumMapToString(EnumMap<SI,Integer> map)
Convert an enumMap of coefficient to the normalized string representation.
|
EnumMap<SI,Integer> |
getCoefficientsMap() |
static SICoefficients |
multiply(SICoefficients a,
SICoefficients b) |
static String |
normalize(String coefficientString)
Convert a coefficient string to standard format.
|
static EnumMap<SI,Integer> |
parse(String coefficientString) |
String |
toString() |
protected static String enumMapToString(EnumMap<SI,Integer> map)
map
- EnumMap<SI
, Integer>; the EnumMappublic static String normalize(String coefficientString) throws UnitException
coefficientString
- String; the string to convertUnitException
- when the coefficientString could not be parsedpublic static EnumMap<SI,Integer> parse(String coefficientString) throws UnitException
coefficientString
- String; such as kgm/s2 or kg-2m^3/s2A or Kmmol3/Askcd4 or mol. <br> The grammar of a
coefficientString is:coefficientString | ::= | <empty> | [ 1 | powerString ] | [ '1 /' powerString ] |
powerString | ::= | unitName [ [ ^ ] integer ] [ [ dotOrSlash ] powerString ] |
dotOrSlash | ::= | . | / |
unitName | ::= | kg | m | s | A | K | cd | mol |
UnitException
- if the coefficientString is not parsable.public static SICoefficients multiply(SICoefficients a, SICoefficients b)
a
- SICoefficients; the first set of coefficientsb
- SICoefficients; the second set of coefficientspublic static SICoefficients divide(SICoefficients a, SICoefficients b)
a
- SICoefficients; the first set of coefficientsb
- SICoefficients; the second set of coefficientsCopyright © 2015–2019 Delft University of Technology. All rights reserved.