@Platform(include="<nix/util/util.hpp>") @Platform(value="linux",link="nix@.1",preload="hdf5@.7") @Platform(value="windows",link="nix",preload={"hdf5","msvcp120","msvcr120","szip","zlib"}) @Namespace(value="nix::util") public class Util extends Object
Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
static void |
applyPolynomial(double[] coefficients,
double origin,
double[] input,
double[] output,
long n)
Apply polynomial.
|
static double |
convertToKelvin(String unit,
double value)
Converts temperatures given in degrees Celsius of Fahrenheit to Kelvin.
|
static long |
convertToKelvin(String unit,
long value)
Converts temperatures given in degrees Celsius of Fahrenheit to Kelvin.
|
static double |
convertToSeconds(String unit,
double value)
Converts temperatures given in degrees Celsius of Fahrenheit to Kelvin.
|
static long |
convertToSeconds(String unit,
long value)
Converts temperatures given in degrees Celsius of Fahrenheit to Kelvin.
|
static String |
createId()
Generates an ID-String.
|
static String |
deblankString(String str)
Remove blank spaces from the entire string
|
static double |
getSIScaling(String originUnit,
String destinationUnit)
Get the scaling between two SI units that are identified by the two strings.
|
static boolean |
isAtomicSIUnit(String unit)
Checks if the passed string represents a valid SI unit.
|
static boolean |
isCompoundSIUnit(String unit)
Checks if the passed string is a valid combination of SI units.
|
static boolean |
isScalable(List<String> unitsA,
List<String> unitsB)
Returns whether or not in all cases the units at the same
index in the two given unit vectors are scalable versions of the same
SI unit.
|
static boolean |
isScalable(String unitA,
String unitB)
Returns whether or not two units represent scalable versions
of the same SI unit.
|
static boolean |
isSetAtSamePos(List<String> stringsA,
List<String> stringsB)
Returns whether or not in all cases the strings at the same
index in the two given string vectors are either both set or both
not set (empty).
|
static boolean |
isSIUnit(String unit)
Checks if the passed string represents a valid SI unit.
|
static boolean |
nameCheck(String name)
Check if the name is legit or needs the
nameSanitizer(String) |
static String |
nameSanitizer(String name)
Replace forbidden chars in name string
|
static List<String> |
splitCompoundUnit(String compoundUnit)
Splits a SI unit compound into its atomic parts.
|
static String[] |
splitUnit(String fullUnit)
Splits an SI unit into prefix, unit and the power components.
|
static void |
splitUnit(String fullUnit,
org.bytedeco.javacpp.BytePointer prefix,
org.bytedeco.javacpp.BytePointer unit,
org.bytedeco.javacpp.BytePointer power) |
static <T extends Entity> |
toId(T entity)
Extract id from given entity.
|
static <T extends NamedEntity> |
toName(T entity)
Extract name from given entity.
|
static String |
unitSanitizer(String unit)
Sanitizer function that deblanks units and replaces mu and µ
with the "u" replacement.
|
public static String deblankString(String str)
str
- The string to trim.@StdString public static String nameSanitizer(@StdString String name)
name
- The string to sanitize@ByVal public static boolean nameCheck(@StdString String name)
nameSanitizer(String)
name
- The string to check@StdString public static String createId()
public static <T extends Entity> String toId(T entity)
public static <T extends NamedEntity> String toName(T entity)
@StdString public static String unitSanitizer(@StdString String unit)
unit
- The old unit.public static boolean isSIUnit(@StdString String unit)
unit
- A string that is supposed to represent an SI unit.public static boolean isAtomicSIUnit(@StdString String unit)
unit
- A string that is supposed to represent an SI unit.public static boolean isCompoundSIUnit(@StdString String unit)
For example mV^2*Hz^-1. Method accepts only the * notation.
unit
- A string that should be testedpublic static boolean isScalable(@StdString String unitA, @StdString String unitB)
unitA
- A string representing the first unit.unitB
- A string representing the second unit.public static boolean isScalable(List<String> unitsA, List<String> unitsB)
unitsA
- A vector of unit strings.unitsB
- A vector of unit strings.public static boolean isSetAtSamePos(List<String> stringsA, List<String> stringsB)
stringsA
- A list of unit strings.stringsB
- A list of unit strings.public static double getSIScaling(@StdString String originUnit, @StdString String destinationUnit)
originUnit
- The original unitdestinationUnit
- The one into which a scaling should be donepublic static void splitUnit(@StdString String fullUnit, @ByRef @StdString org.bytedeco.javacpp.BytePointer prefix, @ByRef @StdString org.bytedeco.javacpp.BytePointer unit, @ByRef @StdString org.bytedeco.javacpp.BytePointer power)
public static String[] splitUnit(String fullUnit)
fullUnit
- unitpublic static List<String> splitCompoundUnit(@StdString String compoundUnit)
compoundUnit
- An SI unit that consists of many atomic unitspublic static double convertToSeconds(@StdString String unit, double value)
unit
- The original unit {"F", "°F", "C", "°C"}value
- The original valuepublic static long convertToSeconds(@StdString String unit, long value)
unit
- The original unit {"F", "°F", "C", "°C"}value
- The original valuepublic static double convertToKelvin(@StdString String unit, double value)
unit
- The original unit {"F", "°F", "C", "°C"}value
- The original valuepublic static long convertToKelvin(@StdString String unit, long value)
unit
- The original unit {"F", "°F", "C", "°C"}value
- The original valuepublic static void applyPolynomial(@StdVector double[] coefficients, double origin, @Const double[] input, double[] output, @Cast(value="size_t") long n)
coefficients
- coefficientsorigin
- origininput
- inputoutput
- outputn
- nCopyright © 2016. All rights reserved.