public class DncMiscUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DncMiscUtils.ThrowingRunnable |
Constructor and Description |
---|
DncMiscUtils() |
Modifier and Type | Method and Description |
---|---|
static <F,T> java.util.function.Function<F,T> |
constFunc(T value) |
static MappedByteBuffer |
createAndMemmapReadWrite(File file,
int newFileSize) |
static File |
createNewDir(File dir) |
static File |
createNewDir(File parentDir,
String childPath) |
static File |
createNewDir(String dirPath) |
static File |
filenameToLowercase(File file)
Lowercases the last segment of the specified path.
|
static File |
filenameToUppercase(File file)
Uppercases the last segment of the specified path.
|
static <T> it.unimi.dsi.fastutil.objects.Object2IntMap<T> |
invertIdsMap(it.unimi.dsi.fastutil.ints.Int2ObjectMap<T> idsMap) |
static <T> it.unimi.dsi.fastutil.objects.Object2IntMap<T> |
invertList(List<T> list) |
static boolean |
isFilenameCaseSensitive(File file) |
static <T> T |
last(List<T> list) |
static MappedByteBuffer |
memmapReadOnly(File file) |
static MappedByteBuffer |
memmapReadWrite(File file) |
static java.util.function.Function<String,Object> |
newAttrsFunc(Map<String,Object> map) |
static Map<String,Object> |
newAttrsMap(Object... keysAndValues) |
static ThreadFactory |
newThreadFactory(String namePrefix,
boolean isDaemon) |
static ExecutorService |
newWorkerDaemon(String threadNamePrefix)
Creates an executor with a single daemon thread and an
unbounded job queue.
|
static int |
nextPowerOfTwo(int x)
Throws
IllegalArgumentException if x is negative |
static long |
packBytesIntoLong(byte[] bytes) |
static void |
poslim(Buffer buf,
int first,
int count,
int size) |
static it.unimi.dsi.fastutil.ints.Int2ObjectMap<String> |
readIdsMapFile(File file,
Charset charset) |
static String |
repchar(char c,
int n) |
static <T> T |
requireResult(Future<? extends T> future) |
static <V> List<V> |
sorted(Collection<V> values,
Comparator<? super V> comparator) |
static Thread |
startThread(String name,
boolean daemon,
Runnable runnable) |
static int |
sum(int... xs) |
static <V> V |
takeNewValue(BlockingQueue<V> queue,
V oldValue) |
static long |
timeSince_MILLIS(long start_PMILLIS) |
static <T> ArrayList<T> |
toArrayList(Iterable<? extends T> iterable) |
static byte[] |
unpackLongIntoBytes(long packed) |
static void |
writeIdsMapFile(it.unimi.dsi.fastutil.objects.Object2IntMap<String> idsMap,
File file,
Charset charset) |
public static final long MiB
public static final long GiB
public static <T> T requireResult(Future<? extends T> future)
public static <V> V takeNewValue(BlockingQueue<V> queue, V oldValue) throws InterruptedException
InterruptedException
public static ExecutorService newWorkerDaemon(String threadNamePrefix)
public static ThreadFactory newThreadFactory(String namePrefix, boolean isDaemon)
public static int nextPowerOfTwo(int x)
IllegalArgumentException
if x is negativepublic static int sum(int... xs)
public static long timeSince_MILLIS(long start_PMILLIS)
public static <V> List<V> sorted(Collection<V> values, Comparator<? super V> comparator)
public static <T> T last(List<T> list)
public static boolean isFilenameCaseSensitive(File file)
public static File filenameToLowercase(File file)
public static File filenameToUppercase(File file)
public static MappedByteBuffer memmapReadOnly(File file) throws IOException
IOException
public static MappedByteBuffer memmapReadWrite(File file) throws IOException
IOException
public static MappedByteBuffer createAndMemmapReadWrite(File file, int newFileSize) throws IOException
IOException
public static void poslim(Buffer buf, int first, int count, int size)
public static long packBytesIntoLong(byte[] bytes)
public static byte[] unpackLongIntoBytes(long packed)
public static String repchar(char c, int n)
public static void writeIdsMapFile(it.unimi.dsi.fastutil.objects.Object2IntMap<String> idsMap, File file, Charset charset) throws IOException
IOException
public static it.unimi.dsi.fastutil.ints.Int2ObjectMap<String> readIdsMapFile(File file, Charset charset) throws IOException
IOException
public static <T> it.unimi.dsi.fastutil.objects.Object2IntMap<T> invertIdsMap(it.unimi.dsi.fastutil.ints.Int2ObjectMap<T> idsMap)
public static <T> it.unimi.dsi.fastutil.objects.Object2IntMap<T> invertList(List<T> list)
public static <F,T> java.util.function.Function<F,T> constFunc(T value)
public static java.util.function.Function<String,Object> newAttrsFunc(Map<String,Object> map)
Copyright © 2016 Metron, Inc.. All rights reserved.