public class IRSignal
extends java.lang.Object
Each pulses of the signal are registered as OFF, ON contiguous periods.
Constructor and Description |
---|
IRSignal(int[] signal)
Constructor for a new signal, using the specific int[] signal data input
corresponding to the raw composition of the signal.
|
IRSignal(java.lang.String name,
int[] signal)
Constructor for a new signal, using the specific int[] signal data input
corresponding to the raw composition of the signal, and using a specific name.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName()
Get the name corresponding to this signal.
|
int |
getNbPulses()
Get the number of pulses composing the signal.
|
int[] |
getPulses()
Get the complete array of OFF/ON periods.
|
boolean |
matches(IRSignal signal,
int tolerance)
Returns true if the specific input signal corresponds to this signal,
with a fuzziness of tolerance %.
|
java.lang.String |
toJavaIntArrayRepresentation()
This method is mainly a utils methods.
|
java.lang.String |
toString() |
public IRSignal(int[] signal)
signal
- the int[] data input corresponding to the raw composition of the signal (OFF/ON periods).public IRSignal(java.lang.String name, int[] signal)
name
- the name to link to this signal.signal
- the int[] data input corresponding to the raw composition of the signal (OFF/ON periods).public int getNbPulses()
public int[] getPulses()
Only the 2 * nbPulses first elements of this array are composing the signal.
public java.lang.String getName()
public boolean matches(IRSignal signal, int tolerance)
signal
- the signal to compare with the current instance.tolerance
- the fuzziness to use for the comparison, in %.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toJavaIntArrayRepresentation()
It returns the String representation of the composition of the signal, in the Java int[] format: "int irSignal[] = {...};"