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
FieldsModifier and TypeFieldDescriptionstatic final longstatic final longstatic final BitwiseParameterstatic final BitwiseParameter -
Constructor Summary
ConstructorsConstructorDescriptionBitwiseParameter(boolean b) BitwiseParameter(long value) BitwiseParameter(long value, long bitmask) -
Method Summary
Modifier and TypeMethodDescriptionvoidaggregate(BitwiseParameter parameter) voidappend(BitwiseParameter other) voidassign(long value) booleancheck(long payload, long bitmask) Checks that the value payload is consistent with the current object, and throws a SignalRecognitionException if not.voidcheckConsistency(String name, long val) booleancovers(long bm) booleancoversWidth(long width) booleanlonglonggetValue()inthashCode()booleanisConsistent(long val) booleanisConsistent(BitwiseParameter parameter) booleanisFinished(Long bitmask) booleanisKnown()intlength()static intlength(long x) longmul(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()
-