Package com.biglybt.core.util
Class GeneralUtils
- java.lang.Object
-
- com.biglybt.core.util.GeneralUtils
-
public class GeneralUtils extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
GeneralUtils.SmoothAverage
private static class
GeneralUtils.SmoothAverage1
private static class
GeneralUtils.SmoothAverage2
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
REGEX_URLHTML
private static int
SMOOTHING_UPDATE_INTERVAL
private static int
SMOOTHING_UPDATE_WINDOW
private static java.util.Map<java.lang.String,java.lang.Integer>
unit_map
(package private) static long[]
unit_values
-
Constructor Summary
Constructors Constructor Description GeneralUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.ProcessBuilder
createProcessBuilder(java.io.File workingDir, java.lang.String[] cmd, java.lang.String[] extra_env)
static boolean
endsWithDoubleQuote(java.lang.String str)
private static java.lang.String
escapeDosCmd(java.lang.String string)
static GeneralUtils.SmoothAverage
getSmoothAverage()
static GeneralUtils.SmoothAverage
getSmoothAverageForReplay()
static int
getSmoothUpdateInterval()
static int
getSmoothUpdateWindow()
static long
getUnitMultiplier(java.lang.String unit, boolean treat_decimal_as_binary)
static boolean
isDoubleQuote(char c)
static boolean
isSingleQuote(char c)
static void
main(java.lang.String[] args)
static java.lang.String
replaceAll(java.lang.String str, java.lang.String[] from_strs, java.lang.String[] to_strs)
as above but does safe replacement of multiple strings (i.e.static java.lang.String[]
splitQuotedTokens(java.lang.String str)
splits space separated tokens respecting quotes (either " or ' )static boolean
startsWithDoubleQuote(java.lang.String str)
static boolean
startsWithIgnoreCase(java.lang.String s1, java.lang.String s2)
static java.lang.String
stringJoin(java.util.Collection list, java.lang.String delim)
static java.lang.String
stripOutHyperlinks(java.lang.String message)
-
-
-
Field Detail
-
REGEX_URLHTML
private static final java.lang.String REGEX_URLHTML
- See Also:
- Constant Field Values
-
SMOOTHING_UPDATE_WINDOW
private static int SMOOTHING_UPDATE_WINDOW
-
SMOOTHING_UPDATE_INTERVAL
private static int SMOOTHING_UPDATE_INTERVAL
-
unit_map
private static java.util.Map<java.lang.String,java.lang.Integer> unit_map
-
unit_values
static long[] unit_values
-
-
Method Detail
-
replaceAll
public static java.lang.String replaceAll(java.lang.String str, java.lang.String[] from_strs, java.lang.String[] to_strs)
as above but does safe replacement of multiple strings (i.e. a match in the replacement of one string won't be substituted by another)- Parameters:
str
-from_strs
-to_strs
-- Returns:
-
stripOutHyperlinks
public static java.lang.String stripOutHyperlinks(java.lang.String message)
-
splitQuotedTokens
public static java.lang.String[] splitQuotedTokens(java.lang.String str)
splits space separated tokens respecting quotes (either " or ' )- Parameters:
str
-- Returns:
-
createProcessBuilder
public static java.lang.ProcessBuilder createProcessBuilder(java.io.File workingDir, java.lang.String[] cmd, java.lang.String[] extra_env) throws java.io.IOException
- Throws:
java.io.IOException
-
escapeDosCmd
private static java.lang.String escapeDosCmd(java.lang.String string)
-
getSmoothUpdateWindow
public static int getSmoothUpdateWindow()
-
getSmoothUpdateInterval
public static int getSmoothUpdateInterval()
-
getSmoothAverageForReplay
public static GeneralUtils.SmoothAverage getSmoothAverageForReplay()
-
getSmoothAverage
public static GeneralUtils.SmoothAverage getSmoothAverage()
-
stringJoin
public static java.lang.String stringJoin(java.util.Collection list, java.lang.String delim)
-
isDoubleQuote
public static boolean isDoubleQuote(char c)
-
isSingleQuote
public static boolean isSingleQuote(char c)
-
startsWithDoubleQuote
public static boolean startsWithDoubleQuote(java.lang.String str)
-
endsWithDoubleQuote
public static boolean endsWithDoubleQuote(java.lang.String str)
-
startsWithIgnoreCase
public static boolean startsWithIgnoreCase(java.lang.String s1, java.lang.String s2)
-
getUnitMultiplier
public static long getUnitMultiplier(java.lang.String unit, boolean treat_decimal_as_binary)
-
main
public static void main(java.lang.String[] args)
-
-