public class IrpUtils extends Object
Modifier and Type | Field and Description |
---|---|
static long |
all |
static String |
decodeIrUrl |
static double |
defaultAbsoluteTolerance
Default absolute tolerance in micro seconds.
|
static String |
defaultConfigfile |
static double |
defaultFrequency
Use if no information at all available.
|
static double |
defaultFrequencyTolerance
Default absolute tolerance for frequency comparison.
|
static double |
defaultMinRepeatLastGap
Default min repeat last gap, in milli seconds.
|
static double |
defaultRelativeTolerance
Default relative tolerance as a number between 0 and 1.
|
static Charset |
dumbCharset |
static String |
dumbCharsetName |
static Locale |
dumbLocale |
static int |
exitConfigReadError |
static int |
exitConfigWriteError |
static int |
exitDynamicLinkError |
static int |
exitFatalProgramFailure |
static int |
exitInternalFailure |
static int |
exitIoError |
static int |
exitRestart |
static int |
exitSemanticUsageError |
static int |
exitSuccess |
static int |
exitThisCannotHappen |
static int |
exitUsageError |
static int |
exitXmlError |
static long |
invalid |
static String |
irpNotationUrl |
static String |
jp1WikiUrl |
static double |
microseconds2seconds |
static double |
milliseconds2microseconds |
static double |
milliseconds2seconds |
static double |
seconds2microseconds |
static double |
seconds2milliseconds |
static long |
some |
static double |
unknownDutyCycle |
Constructor and Description |
---|
IrpUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
addExtensionIfNotPresent(String filename,
String extension) |
static String |
basename(String s) |
static InputStream |
getInputSteam(String filename)
Either opens an input file or returns stdin.
|
static PrintStream |
getPrintSteam(String filename)
Either opens a file (optionally for appending (if beginning with +)) or returns stdout.
|
static boolean |
isEqual(double x,
double y,
double absoluteTolerance,
double relativeTolerance)
Tests for approximate equality.
|
static boolean |
isEqual(int x,
int y,
int absoluteTolerance,
double relativeTolerance)
Tests for approximate equality.
|
static boolean |
isInstance(Object o,
String classname) |
static String |
join(int beg,
String[] s,
String separator)
Joins the Strings in the second argument, starting at the first argument, separating them with the third argument.
|
static String |
join(Iterable<String> payload,
String separator) |
static String |
join(String[] s,
char separator) |
static String |
join(String[] s,
String separator) |
static double |
l1Norm(double[] sequence) |
static double |
l1Norm(Double[] sequence) |
static double |
l1Norm(double[] sequence,
int beg,
int length) |
static void |
main(String[] args) |
static HashMap<String,Long> |
mkParameters(long D,
long S,
long F) |
static long |
parseLong(String str)
Parses integers of base 2 (prefix "0b" or "%", 8 (leading 0), 10, or 16 (prefix "0x).
|
static long |
parseLong(String str,
boolean special)
Parses integers of base 2 (prefix "0b" or "%", 8 (leading 0), 10, or 16 (prefix "0x).
|
static long |
parseUpper(String str) |
static long |
power(long x,
long y)
The power function for long arguments.
|
static long |
reverse(long x,
int width)
Reverses the bits, living in a width-bit wide world.
|
static String |
spaces(int length) |
static String |
stringArray(int[] array) |
static long |
variableGet(Map<String,Long> map,
String name) |
static String |
variableHeader(HashMap<String,Long> params)
Produces a header in the spirit of Makehex.
|
public static final String defaultConfigfile
public static final String dumbCharsetName
public static final Charset dumbCharset
public static final Locale dumbLocale
public static final long invalid
public static final long all
public static final long some
public static final int exitSuccess
public static final int exitUsageError
public static final int exitSemanticUsageError
public static final int exitFatalProgramFailure
public static final int exitInternalFailure
public static final int exitConfigReadError
public static final int exitConfigWriteError
public static final int exitIoError
public static final int exitXmlError
public static final int exitDynamicLinkError
public static final int exitThisCannotHappen
public static final int exitRestart
public static final String jp1WikiUrl
public static final String irpNotationUrl
public static final String decodeIrUrl
public static final double defaultFrequency
public static final double unknownDutyCycle
public static final double microseconds2seconds
public static final double seconds2microseconds
public static final double milliseconds2seconds
public static final double seconds2milliseconds
public static final double milliseconds2microseconds
public static final double defaultAbsoluteTolerance
public static final double defaultRelativeTolerance
public static final double defaultFrequencyTolerance
public static final double defaultMinRepeatLastGap
public static String join(int beg, String[] s, String separator)
beg
- Index of first argument to consider,s
- Array of strings to be joinedseparator
- public static String stringArray(int[] array)
public static double l1Norm(Double[] sequence)
public static double l1Norm(double[] sequence)
public static double l1Norm(double[] sequence, int beg, int length)
public static String spaces(int length)
public static PrintStream getPrintSteam(String filename) throws FileNotFoundException
filename
- Either - for stdout, or a file name, or null. If starting with +, the file is opened in append mode, after removing the +-character.FileNotFoundException
- if FileOutputStream doespublic static InputStream getInputSteam(String filename) throws FileNotFoundException
filename
- FileNotFoundException
public static boolean isEqual(double x, double y, double absoluteTolerance, double relativeTolerance)
x
- first argumenty
- second argumentabsoluteTolerance
- relativeTolerance
- public static boolean isEqual(int x, int y, int absoluteTolerance, double relativeTolerance)
x
- first argumenty
- second argumentabsoluteTolerance
- relativeTolerance
- public static long power(long x, long y)
x
- longy
- long, non-negativeArithmeticException
public static long reverse(long x, int width)
x
- width
- public static long parseLong(String str, boolean special)
str
- String to be parsedspecial
- If the special stuff should be interpreted ('*', '+', intervals).public static long parseLong(String str)
str
- String to be parsedpublic static long parseUpper(String str)
public static String variableHeader(HashMap<String,Long> params)
params
- tests- irpmaster?HashMap<String, Long> of input parameters.public static String addExtensionIfNotPresent(String filename, String extension)
public static void main(String[] args)
Copyright © 2016. All rights reserved.