Package com.cobber.fta.core
Class Utils
- java.lang.Object
-
- com.cobber.fta.core.Utils
-
public abstract class Utils extends java.lang.Object
A Utility class with a set of helper functions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
allZeroes(java.lang.String input)
static int
getValue(java.lang.String input, int offset, int minLength, int maxLength)
Give a String as input with an offset and length return the integer at that position.static java.lang.String
getVersion()
Get the version of the FTA library.static java.lang.String
repeat(char c, int count)
static java.lang.String
replaceAt(java.lang.String input, int offset, int length, java.lang.String newString)
static java.lang.String
replaceFirst(java.lang.String input, java.lang.String oldString, java.lang.String newString)
static <K,V extends java.lang.Comparable<? super V>>
java.util.Map<K,V>sortByValue(java.util.Map<K,V> map)
-
-
-
Method Detail
-
sortByValue
public static <K,V extends java.lang.Comparable<? super V>> java.util.Map<K,V> sortByValue(java.util.Map<K,V> map)
-
replaceFirst
public static java.lang.String replaceFirst(java.lang.String input, java.lang.String oldString, java.lang.String newString)
-
replaceAt
public static java.lang.String replaceAt(java.lang.String input, int offset, int length, java.lang.String newString)
-
repeat
public static java.lang.String repeat(char c, int count)
-
getValue
public static int getValue(java.lang.String input, int offset, int minLength, int maxLength)
Give a String as input with an offset and length return the integer at that position.- Parameters:
input
- String to extract integer fromoffset
- Integer offset that marks the startminLength
- minimum length of integer to be extracted.maxLength
- maximum length of integer to be extracted.- Returns:
- An integer value from the supplied String.
-
allZeroes
public static boolean allZeroes(java.lang.String input)
- Parameters:
input
- Test if the supplied input is a string of all 0's.- Returns:
- True if input is a string of 0's.
-
getVersion
public static java.lang.String getVersion()
Get the version of the FTA library.- Returns:
- The version of the FTA library.
-
-