Class 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 from
        offset - Integer offset that marks the start
        minLength - 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.