Class Utils


  • public final class Utils
    extends Object
    Utility functions - so much for a pure OO language.
    Since:
    3.0.7
    Author:
    "Martin Krischik" «krischik@users.sourceforge.net»
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static Logger Logger
      Class logger instance.
      static long Minutes_3
      Three minutes in nanoseconds
      static long Minutes_6
      Six minutes in nanoseconds
      static long Seconds_1
      One seconds in nanoseconds
      private static String TAG
      Class logger tag.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Utils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int abs​(int Left)  
      static short @NotNull [] concat​(short @NotNull [] Array, short Element)
      Concatenate an element to an arrays - is Java primitive!
      static short @NotNull [] concat​(short @NotNull [] Array_1, short @NotNull [] Array_2)
      Concatenate 2 arrays - is Java primitive!
      static void copy​(short @NotNull [] Destination, int @NotNull [] Source)
      Copy an int array to and short array.
      static void copy​(short @NotNull [] Destination, short @NotNull [] Source)
      Copy an int array to and short array.
      static boolean equals​(boolean @NotNull [] Left, boolean @NotNull [] Right)
      compare the content of two arrays.
      static boolean equals​(short @NotNull [] Left, short @NotNull [] Right)
      compare the content of two arrays.
      static int max​(int Left, int Right)  
      static int max​(int Left, int Middle, int Right)  
      static int max​(int Value_1, int Value_2, int Value_3, int Value_4, int Value_5)  
      static int min​(int Left, int Right)  
      static @Nullable String Read_Line​(InputStreamReader Reader)
      Read line from file
    • Field Detail

      • Logger

        private static final Logger Logger

        Class logger instance.

      • TAG

        private static final String TAG

        Class logger tag.

      • Minutes_3

        public static final long Minutes_3

        Three minutes in nanoseconds

        See Also:
        Constant Field Values
      • Minutes_6

        public static final long Minutes_6

        Six minutes in nanoseconds

        See Also:
        Constant Field Values
      • Seconds_1

        public static final long Seconds_1

        One seconds in nanoseconds

        See Also:
        Constant Field Values
    • Constructor Detail

      • Utils

        private Utils()
    • Method Detail

      • Read_Line

        @Nullable
        public static @Nullable String Read_Line​(@NotNull
                                                 InputStreamReader Reader)
                                          throws IOException
        Read line from file
        Parameters:
        Reader - File to read from
        Returns:
        Line read
        Throws:
        IOException - can't read line
        Since:
        uiq 3.0.7
      • abs

        public static int abs​(int Left)
        Parameters:
        Left - Left value
        Returns:
        Left or right - whichever is larger
        Since:
        uiq 3.0.7
      • concat

        public static short @NotNull [] concat​(short @NotNull [] Array,
                                               short Element)
        Concatenate an element to an arrays - is Java primitive! Ada - of course - can do this out of the box
        Parameters:
        Array - Array to append to
        Element - element to append
        Returns:
        Array_1 & Element
      • concat

        public static short @NotNull [] concat​(short @NotNull [] Array_1,
                                               short @NotNull [] Array_2)
        Concatenate 2 arrays - is Java primitive! Ada - of course - can do this out of the box
        Parameters:
        Array_1 - Array to append to
        Array_2 - Array to append
        Returns:
        Array_1 & Array_2
        Since:
        uiq 3.0.7
      • copy

        public static void copy​(short @NotNull [] Destination,
                                int @NotNull [] Source)
        Copy an int array to and short array.
        Parameters:
        Destination - short array to copy to
        Source - int array to copy from
      • copy

        public static void copy​(short @NotNull [] Destination,
                                short @NotNull [] Source)
        Copy an int array to and short array.
        Parameters:
        Destination - short array to copy to
        Source - int array to copy from
      • equals

        public static boolean equals​(boolean @NotNull [] Left,
                                     boolean @NotNull [] Right)
        compare the content of two arrays.
        Parameters:
        Left - Left array
        Right - right array
        Returns:
        true if both arrays contain the same data
        Since:
        uiq 3.0.7
      • equals

        public static boolean equals​(short @NotNull [] Left,
                                     short @NotNull [] Right)
        compare the content of two arrays.
        Parameters:
        Left - Left array
        Right - right array
        Returns:
        true if both arrays contain the same data
        Since:
        uiq 3.0.7
      • max

        public static int max​(int Left,
                              int Right)
        Parameters:
        Left - Left value
        Right - Right Value
        Returns:
        Left or right - whichever is larger
        Since:
        uiq 3.0.7
      • max

        public static int max​(int Left,
                              int Middle,
                              int Right)
        Parameters:
        Left - Left value
        Middle - Middle Value
        Right - Right Value
        Returns:
        Left or right - whichever is larger
        Since:
        uiq 6.5.2
      • max

        public static int max​(int Value_1,
                              int Value_2,
                              int Value_3,
                              int Value_4,
                              int Value_5)
        Parameters:
        Value_1 - Left value
        Value_2 - Middle Value
        Value_3 - Right Value
        Returns:
        Left or right - whichever is larger
        Since:
        uiq 6.5.2
      • min

        public static int min​(int Left,
                              int Right)
        Parameters:
        Left - Left value
        Right - Right Value
        Returns:
        Left or right - whichever is larger
        Since:
        uiq 3.0.7