Class Utils


  • public class Utils
    extends Object
    • Constructor Detail

      • Utils

        public Utils()
    • Method Detail

      • getWindow

        public static Window getWindow​(Object owner)
                                throws IllegalArgumentException
        Will return a Window from an object if any can be found. null value can be given, the program will then try to find the focused window among those available.
        Parameters:
        owner - the object whose window is to be found.
        Returns:
        the window of the given object.
        Throws:
        IllegalArgumentException
      • getExcelLetterFromNumber

        public static final String getExcelLetterFromNumber​(int number)
        Return a letter (just like Excel) associated with the number. When the number is under 26, a simple letter is returned. When the number is superior, concatenated letters are returned. For example: 0 -> A 1 -> B 26 -> AA 32 -> AG 45 -> AT
        Parameters:
        number - the number whose Excel Letter is to be found.
        Returns:
        a letter (like) associated with the number.
      • clamp

        public static double clamp​(double min,
                                   double value,
                                   double max)
        Simple utility function which clamps the given value to be strictly between the min and max values.
      • nearest

        public static double nearest​(double less,
                                     double value,
                                     double more)
        Utility function which returns either less or more depending on which value is closer to. If value is perfectly between them, then either may be returned.