Package org.harctoolbox.irp
Class BitwiseParameter
java.lang.Object
org.harctoolbox.irp.BitwiseParameter
This object represents a parameter, for which only some bit positions are known.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final long
static final long
static final BitwiseParameter
static final BitwiseParameter
-
Constructor Summary
ConstructorDescriptionBitwiseParameter
(boolean b) BitwiseParameter
(long value) BitwiseParameter
(long value, long bitmask) -
Method Summary
Modifier and TypeMethodDescriptionvoid
aggregate
(BitwiseParameter parameter) void
append
(BitwiseParameter other) void
assign
(long value) boolean
check
(long payload, long bitmask) Checks that the value payload is consistent with the current object, and throws a SignalRecognitionException if not.void
checkConsistency
(String name, long val) boolean
covers
(long bm) boolean
coversWidth
(long width) boolean
long
long
getValue()
int
hashCode()
boolean
isConsistent
(long val) boolean
isConsistent
(BitwiseParameter parameter) boolean
isFinished
(Long bitmask) boolean
isKnown()
int
length()
static int
length
(long x) long
mul
(BitwiseParameter op) restrict
(long newBitmask) toString()
xor
(BitwiseParameter op)
-
Field Details
-
ALLBITS
public static final long ALLBITS- See Also:
-
NOBITS
public static final long NOBITS- See Also:
-
ZERO
-
NULL
-
-
Constructor Details
-
BitwiseParameter
public BitwiseParameter(long value) -
BitwiseParameter
public BitwiseParameter(boolean b) -
BitwiseParameter
public BitwiseParameter() -
BitwiseParameter
public BitwiseParameter(long value, long bitmask) -
BitwiseParameter
-
-
Method Details
-
length
public static int length(long x) -
restrict
-
coversWidth
public boolean coversWidth(long width) -
covers
public boolean covers(long bm) -
length
public int length() -
isConsistent
-
isConsistent
public boolean isConsistent(long val) -
checkConsistency
- Throws:
ParameterInconsistencyException
-
aggregate
-
append
-
equals
-
hashCode
public int hashCode() -
toString
-
getValue
public long getValue()- Returns:
- the value
-
getBitmask
public long getBitmask()- Returns:
- the bitmask
-
assign
public void assign(long value) -
minus
-
mul
-
xor
-
longValueExact
public long longValueExact() -
check
Checks that the value payload is consistent with the current object, and throws a SignalRecognitionException if not.- Parameters:
payload
-bitmask
-- Returns:
- true if the current object covers the bitmask given as argument.
- Throws:
SignalRecognitionException
-
isFinished
-
isKnown
public boolean isKnown()
-