public class Util
extends java.lang.Object
Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
static <K> java.util.List<K> |
addTo(java.util.List<K> s,
K k) |
static <K> java.util.Set<K> |
addTo(java.util.Set<K> s,
K k) |
static void |
closeSilently(java.io.Closeable out) |
static void |
closeSilently(java.sql.Connection c) |
static void |
closeSilently(java.io.InputStream in) |
static void |
closeSilently(java.io.OutputStream out) |
static void |
closeSilently(java.sql.PreparedStatement c) |
static void |
closeSilently(java.io.Reader in) |
static void |
closeSilently(java.sql.ResultSet c) |
static void |
closeSilently(java.util.zip.ZipFile zip) |
static java.lang.String |
commonPrefix(java.lang.String s1,
java.lang.String s2) |
static int |
compare(int x,
int y)
return sign of x - y
|
static int |
compare(long x,
long y)
return sign of x - y
|
static <T> java.util.Set<T> |
emptyOrNonnullSingleton(T t) |
static <E> E |
first(java.lang.Iterable<E> i) |
static java.lang.String |
getFileExtension(java.io.File f) |
static java.lang.String |
getFileExtensionIgnoringGz(java.io.File f) |
static java.io.Reader |
getFileReader(java.io.File filename) |
static java.io.Reader |
getFileReader(java.lang.String filename) |
static java.io.Writer |
getFileWriter(java.lang.String filename) |
static java.security.MessageDigest |
getMD5Digest() |
static java.lang.String |
getNetworkErrorMessage(java.lang.Throwable e) |
static java.io.Reader |
getReader(java.io.InputStream in) |
static java.io.Writer |
getWriter(java.io.OutputStream out) |
static java.lang.String |
getXMLType(java.io.InputStream in) |
static <K,V> java.util.Map<K,V> |
immutableMap(java.util.Map<K,V> map) |
static boolean |
isPowerOfTwo(int i) |
static boolean |
isPowerOfTwo(long i) |
static java.io.IOException |
makeIOException(java.lang.String msg,
java.lang.Throwable cause) |
static <K> java.util.ArrayList<K> |
makeSmallArrayList(java.util.List<K> m) |
static <K,V> java.util.HashMap<K,V> |
makeSmallHashMap(java.util.Map<K,V> m) |
static <K> java.util.HashSet<K> |
makeSmallHashSet(java.util.Collection<K> m) |
static <E> java.util.Set<E> |
newSetFromMap(java.util.Map<E,java.lang.Boolean> m)
Duplication 1.6 functionality of Collections.newSetFromMap
|
static <T extends java.lang.Comparable<? super T>> |
nullSafeCompareTo(T o1,
T o2) |
static <T> boolean |
nullSafeEquals(T o1,
T o2) |
static int |
nullSafeHashcode(java.lang.Object o) |
static java.lang.String |
repeat(java.lang.String s,
int number) |
static java.lang.Thread |
runInDameonThread(java.lang.Runnable r) |
static java.lang.Thread |
runInDameonThread(java.lang.Runnable r,
java.lang.String name) |
static void |
runLogAtShutdown(java.lang.Runnable r) |
static java.lang.Iterable<java.lang.Integer> |
setBitIteratable(java.util.BitSet b) |
static java.util.Iterator<java.lang.Integer> |
setBitIterator(java.util.BitSet b) |
static int |
sign(int x) |
static java.lang.Thread |
startDameonThread(java.lang.Thread t) |
static void |
throwIOException(java.lang.String msg,
java.lang.Throwable cause) |
public static java.lang.Thread startDameonThread(java.lang.Thread t)
public static java.lang.Thread runInDameonThread(java.lang.Runnable r, java.lang.String name)
public static java.lang.Thread runInDameonThread(java.lang.Runnable r)
public static int sign(int x)
public static int compare(int x, int y)
public static int compare(long x, long y)
public static java.lang.Iterable<java.lang.Integer> setBitIteratable(java.util.BitSet b)
public static java.util.Iterator<java.lang.Integer> setBitIterator(java.util.BitSet b)
public static java.lang.String repeat(java.lang.String s, int number)
public static java.lang.String getNetworkErrorMessage(java.lang.Throwable e)
public static void runLogAtShutdown(java.lang.Runnable r)
public static <T> java.util.Set<T> emptyOrNonnullSingleton(T t)
public static <K,V> java.util.Map<K,V> immutableMap(java.util.Map<K,V> map)
public static int nullSafeHashcode(@CheckForNull java.lang.Object o)
public static <T> boolean nullSafeEquals(@CheckForNull T o1, @CheckForNull T o2)
public static <T extends java.lang.Comparable<? super T>> int nullSafeCompareTo(@CheckForNull T o1, @CheckForNull T o2)
public static java.io.Reader getReader(@WillCloseWhenClosed java.io.InputStream in)
public static java.io.Reader getFileReader(java.lang.String filename) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public static java.io.Reader getFileReader(java.io.File filename) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public static java.io.Writer getWriter(@WillCloseWhenClosed java.io.OutputStream out)
public static java.io.Writer getFileWriter(java.lang.String filename) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public static void closeSilently(@WillClose java.sql.Connection c)
public static void closeSilently(@WillClose java.sql.PreparedStatement c)
public static void closeSilently(@WillClose java.sql.ResultSet c)
public static void closeSilently(@WillClose java.io.InputStream in)
public static void closeSilently(@WillClose java.io.Reader in)
public static void closeSilently(@WillClose java.io.OutputStream out)
public static void closeSilently(@WillClose java.io.Closeable out)
public static void closeSilently(@WillClose java.util.zip.ZipFile zip)
public static java.lang.String getXMLType(@WillNotClose java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static java.io.IOException makeIOException(java.lang.String msg, java.lang.Throwable cause)
public static java.lang.String getFileExtension(java.io.File f)
public static java.lang.String getFileExtensionIgnoringGz(java.io.File f)
public static void throwIOException(java.lang.String msg, java.lang.Throwable cause) throws java.io.IOException
java.io.IOException
public static <E> E first(java.lang.Iterable<E> i)
i
- the Iterable whose first element is to be retrievedpublic static java.lang.String commonPrefix(java.lang.String s1, java.lang.String s2)
public static <E> java.util.Set<E> newSetFromMap(java.util.Map<E,java.lang.Boolean> m)
public static <K,V> java.util.HashMap<K,V> makeSmallHashMap(java.util.Map<K,V> m)
public static <K> java.util.HashSet<K> makeSmallHashSet(java.util.Collection<K> m)
public static <K> java.util.ArrayList<K> makeSmallArrayList(java.util.List<K> m)
public static <K> java.util.Set<K> addTo(java.util.Set<K> s, K k)
public static <K> java.util.List<K> addTo(java.util.List<K> s, K k)
@Nonnull public static java.security.MessageDigest getMD5Digest()
public static boolean isPowerOfTwo(int i)
public static boolean isPowerOfTwo(long i)
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.