Class DncMiscUtils


  • public class DncMiscUtils
    extends Object
    • Constructor Detail

      • DncMiscUtils

        public DncMiscUtils()
    • Method Detail

      • requireResult

        public static <T> T requireResult​(Future<? extends T> future)
      • startThread

        public static Thread startThread​(String name,
                                         boolean daemon,
                                         Runnable runnable)
      • newWorkerDaemon

        public static ExecutorService newWorkerDaemon​(String threadNamePrefix)
        Creates an executor with a single daemon thread and an unbounded job queue. Jobs submitted after the executor has been shutdown will be silently dropped.
      • newThreadFactory

        public static ThreadFactory newThreadFactory​(String namePrefix,
                                                     boolean isDaemon)
      • sum

        public static int sum​(int... xs)
      • timeSince_MILLIS

        public static long timeSince_MILLIS​(long start_PMILLIS)
      • toArrayList

        public static <T> ArrayList<T> toArrayList​(Iterable<? extends T> iterable)
      • last

        public static <T> T last​(List<T> list)
      • isFilenameCaseSensitive

        public static boolean isFilenameCaseSensitive​(File file)
      • filenameToLowercase

        public static File filenameToLowercase​(File file)
        Lowercases the last segment of the specified path.
      • filenameToUppercase

        public static File filenameToUppercase​(File file)
        Uppercases the last segment of the specified path.
      • poslim

        public static void poslim​(Buffer buf,
                                  int first,
                                  int count,
                                  int size)
      • packBytesIntoLong

        public static long packBytesIntoLong​(byte[] bytes)
      • unpackLongIntoBytes

        public static byte[] unpackLongIntoBytes​(long packed)
      • repchar

        public static String repchar​(char c,
                                     int n)
      • invertIdsMap

        public static <T> it.unimi.dsi.fastutil.objects.Object2IntMap<T> invertIdsMap​(it.unimi.dsi.fastutil.ints.Int2ObjectMap<T> idsMap)
      • invertList

        public static <T> it.unimi.dsi.fastutil.objects.Object2IntMap<T> invertList​(List<T> list)
      • constFunc

        public static <F,​T> Function<F,​T> constFunc​(T value)
      • createNewDir

        public static File createNewDir​(File parentDir,
                                        String childPath)
      • createNewDir

        public static File createNewDir​(String dirPath)
      • createNewDir

        public static File createNewDir​(File dir)