public final class Utils extends Object
| Modifier and Type | Method and Description |
|---|---|
static double |
average(DoubleStream stream)
Computes the mean value from a Stream of values.
|
static int |
boolToInt(boolean bool)
Converts a boolean to its corresponding int
|
static double |
computePercentage(double partialValue,
double totalValue)
Computes the percentage that a partial value corresponds to a given total.
|
static String |
getFileExtension(String fileName)
Gets the extension of a file.
|
static String |
includeTrailingDirSeparator(String path)
Adds a trailing slash at the end of a path if it doesn't have one yet.
|
static boolean |
isNotStringEmpty(String str) |
static boolean |
isStringEmpty(String str) |
static double |
mean(double... values)
Computes the mean value from a list of values.
|
public static boolean isNotStringEmpty(String str)
public static boolean isStringEmpty(String str)
public static String includeTrailingDirSeparator(String path)
path - the path to include a trailing slashpublic static double computePercentage(double partialValue,
double totalValue)
partialValue - the partial value to compute the percentage related to the total valuetotalValue - the total the partial value corresponds topublic static double mean(double... values)
values - the values to compute the mean frompublic static double average(DoubleStream stream)
stream - the Stream of values to compute the mean frompublic static int boolToInt(boolean bool)
bool - the boolean value to convertCopyright © 2017 Manoel Campos da Silva Filho. All rights reserved.