Package org.harctoolbox.ircore
Class AbstractIrParser
java.lang.Object
org.harctoolbox.ircore.AbstractIrParser
- Direct Known Subclasses:
BracketedIrSignalParser
,MultilineIrSignalParser
,MultiParser
,ProntoParser
,ShortProntoParser
-
Constructor Summary
ConstructorDescriptionAbstractIrParser
(Iterable<? extends CharSequence> args) Equivalent to RawParser(String.join(" ", args));AbstractIrParser
(String source) Main constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected static String
protected final String
protected static IrSignal
mkIrSignal
(String[] codes, Double fallbackFrequency, Double dummyGap) protected static IrSignal
mkIrSignal
(List<IrSequence> list, Double frequency) final IrSequence
toIrSequence
(Double dummyGap) final IrSignal
final IrSignal
toIrSignal
(Double fallbackFrequency) Tries to interpret the string argument as one of our known formats, and return an IrSignal.abstract IrSignal
toIrSignal
(Double fallbackFrequency, Double dummyGap) toIrSignalChop
(Double fallbackFrequency, double threshold) final List<IrSequence>
toList()
protected final List<IrSequence>
final List<IrSequence>
toListChop
(double threshold) toListChop
(double threshold, Double dummyGap) Equivalent to toIrSequence().chop(threshold);final ModulatedIrSequence
final ModulatedIrSequence
toModulatedIrSequence
(Double fallbackFrequency) toModulatedIrSequence
(Double fallbackFrequency, Double dummyGap) final String
toString()
-
Constructor Details
-
AbstractIrParser
Main constructor- Parameters:
source
- string to be paraed
-
AbstractIrParser
Equivalent to RawParser(String.join(" ", args));- Parameters:
args
- Will be concatenated, with space in between, then parsed.
-
-
Method Details
-
fixIrRemoteSilliness
-
mkIrSignal
protected static IrSignal mkIrSignal(List<IrSequence> list, Double frequency) throws OddSequenceLengthException - Throws:
OddSequenceLengthException
-
mkIrSignal
protected static IrSignal mkIrSignal(String[] codes, Double fallbackFrequency, Double dummyGap) throws OddSequenceLengthException - Throws:
OddSequenceLengthException
-
toString
-
toListChop
public List<IrSequence> toListChop(double threshold, Double dummyGap) throws OddSequenceLengthException, InvalidArgumentException Equivalent to toIrSequence().chop(threshold);- Parameters:
threshold
-dummyGap
-- Returns:
- Throws:
OddSequenceLengthException
InvalidArgumentException
-
toListChop
public final List<IrSequence> toListChop(double threshold) throws OddSequenceLengthException, InvalidArgumentException -
toList
public List<IrSequence> toList(Double dummyGap) throws OddSequenceLengthException, InvalidArgumentException - Parameters:
dummyGap
-- Returns:
- Throws:
OddSequenceLengthException
InvalidArgumentException
-
toList
protected final List<IrSequence> toList(String[] parts, Double dummyGap) throws OddSequenceLengthException - Parameters:
parts
-dummyGap
-- Returns:
- Throws:
OddSequenceLengthException
-
toList
-
toModulatedIrSequence
public ModulatedIrSequence toModulatedIrSequence(Double fallbackFrequency, Double dummyGap) throws InvalidArgumentException - Throws:
InvalidArgumentException
-
toModulatedIrSequence
public final ModulatedIrSequence toModulatedIrSequence(Double fallbackFrequency) throws OddSequenceLengthException, InvalidArgumentException -
toModulatedIrSequence
public final ModulatedIrSequence toModulatedIrSequence() throws OddSequenceLengthException, InvalidArgumentException -
getSource
- Returns:
-
toIrSequence
-
toIrSequence
public IrSequence toIrSequence(Double dummyGap) throws OddSequenceLengthException, InvalidArgumentException -
toIrSignal
-
toIrSignal
public final IrSignal toIrSignal(Double fallbackFrequency) throws OddSequenceLengthException, InvalidArgumentException, NumberFormatException Tries to interpret the string argument as one of our known formats, and return an IrSignal. If the string starts with "[", interpret it as raw data, already split in intro-, repeat-, and ending sequences.. If it contains more than on line, assume that the caller has split it into intro, repeat, and ending sequences already. Im particular, if no particular structure is found, returns null.- Parameters:
fallbackFrequency
- Modulation frequency to use, if it cannot be inferred from the source string. For no information, use null.- Returns:
- IrSignal, or null on failure.
- Throws:
OddSequenceLengthException
InvalidArgumentException
NumberFormatException
-
toIrSignal
public abstract IrSignal toIrSignal(Double fallbackFrequency, Double dummyGap) throws OddSequenceLengthException, InvalidArgumentException, NumberFormatException -
toIrSignalChop
public IrSignal toIrSignalChop(Double fallbackFrequency, double threshold) throws OddSequenceLengthException, InvalidArgumentException
-