public class SICoefficients extends Object
Copyright (c) 2015-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
$LastChangedDate: 2018-01-28 03:17:44 +0100 (Sun, 28 Jan 2018) $, @version $Revision: 256 $, 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
- such as kgm/s2 or kg-2m^3/s2A or Kmmol3/Askcd4 or mol. 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
- the first set of coefficientsb
- the second set of coefficientspublic static SICoefficients divide(SICoefficients a, SICoefficients b)
a
- the first set of coefficientsb
- the second set of coefficientsCopyright © 2015–2018 Delft University of Technology. All rights reserved.