public class Utils extends Object
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static void |
assertTrue(boolean cond) |
static int |
ceilLog2(float value) |
static <T> T |
checkNotNull(T object) |
static float |
clamp(float x,
float min,
float max) |
static int |
clamp(int x,
int min,
int max) |
static long |
clamp(long x,
long min,
long max) |
static void |
closeSilently(Closeable c) |
static void |
closeSilently(Cursor cursor) |
static void |
closeSilently(ParcelFileDescriptor fd) |
static int |
compare(long a,
long b) |
static String[] |
copyOf(String[] source,
int newSize) |
static long |
crc64Long(byte[] buffer) |
static long |
crc64Long(String in)
A function thats returns a 64-bit crc for string
|
static void |
debug(String message,
Object... args) |
static String |
ensureNotNull(String value) |
static boolean |
equals(Object a,
Object b) |
static String |
escapeXml(String s) |
static void |
fail(String message,
Object... args) |
static int |
floorLog2(float value) |
static byte[] |
getBytes(String in) |
static String |
getUserAgent(Context context) |
static boolean |
handleInterrruptedException(Throwable e) |
static float |
interpolateAngle(float source,
float target,
float progress) |
static float |
interpolateScale(float source,
float target,
float progress) |
static boolean |
isNullOrEmpty(String exifMake) |
static boolean |
isOpaque(int color) |
static String |
maskDebugInfo(Object info) |
static int |
nextPowerOf2(int n) |
static float |
parseFloatSafely(String content,
float defaultValue) |
static int |
parseIntSafely(String content,
int defaultValue) |
static int |
prevPowerOf2(int n) |
static void |
swap(int[] array,
int i,
int j) |
static void |
waitWithoutInterrupt(Object object) |
public static void assertTrue(boolean cond)
public static <T> T checkNotNull(T object)
public static int nextPowerOf2(int n)
public static int prevPowerOf2(int n)
public static int clamp(int x, int min, int max)
public static float clamp(float x, float min, float max)
public static long clamp(long x, long min, long max)
public static boolean isOpaque(int color)
public static void swap(int[] array, int i, int j)
public static final long crc64Long(String in)
in
- input stringpublic static final long crc64Long(byte[] buffer)
public static byte[] getBytes(String in)
public static void closeSilently(Closeable c)
public static int compare(long a, long b)
public static int ceilLog2(float value)
public static int floorLog2(float value)
public static void closeSilently(ParcelFileDescriptor fd)
public static void closeSilently(Cursor cursor)
public static float interpolateAngle(float source, float target, float progress)
public static float interpolateScale(float source, float target, float progress)
public static float parseFloatSafely(String content, float defaultValue)
public static int parseIntSafely(String content, int defaultValue)
public static boolean isNullOrEmpty(String exifMake)
public static void waitWithoutInterrupt(Object object)
public static boolean handleInterrruptedException(Throwable e)
public static String escapeXml(String s)