public class BitwiseOperationBuilderImpl extends Object implements BitwiseOperationBuilder
Constructor and Description |
---|
BitwiseOperationBuilderImpl() |
Modifier and Type | Method and Description |
---|---|
Integer |
getValue() |
protected static boolean |
isBitwiseMaskable(int aValue,
int aMask)
Tests if the bits set in the parameter mask are also set in the parameter
value.
|
boolean |
isMaskable(Integer aMask)
Tests if the bits set in the mask argument are also set in the value
property ("the value property is maskable with the given mask").
|
boolean |
isTrueAt(int aPosition)
Checks if is true at.
|
protected static boolean |
isTrueAt(int aValue,
int aPos)
Tests whether the bit at the given position is set in the parameter value
and returns true if this is the case.
|
void |
setValue(Integer aValue) |
protected static int |
toBitwiseAND(int aValueA,
int aValueB)
The result of this method is a contransceiver of the parameters valueA
and valueB.
|
protected static int |
toBitwiseNOT(int aValue)
The result of this method is the negation of the given value.
|
protected static int |
toBitwiseOR(int aValueA,
int aValueB)
The result of this method is a distransceiver of the parameters valueA
and valueB.
|
protected static int |
toBitwiseXOR(int aValueA,
int aValueB)
The result of this method is an exclusive distransceiver of the
parameters valueA and valueB.
|
BitwiseOperationBuilder |
withAnd(Integer aOperand)
Applies a bitwise AND operation to the value property with the given
operand; the value is updated accordingly and the result can be retrieved
with the
ValueAccessor.getValue() method. |
BitwiseOperationBuilder |
withNot()
Applies a bitwise NOT operation to the value property ; the value is
updated accordingly and the result can be retrieved with the
ValueAccessor.getValue() method. |
BitwiseOperationBuilder |
withOr(Integer aOperand)
Applies a bitwise OR operation to the value property with the given
operand; the value is updated accordingly and the result can be retrieved
with the
ValueAccessor.getValue() method. |
BitwiseOperationBuilder |
withXor(Integer aOperand)
Applies a bitwise XOR operation to the value property with the given
operand; the value is updated accordingly and the result can be retrieved
with the
ValueAccessor.getValue() method. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
withValue
public Integer getValue()
getValue
in interface org.refcodes.mixin.ValueAccessor<Integer>
public void setValue(Integer aValue)
setValue
in interface org.refcodes.mixin.ValueAccessor.ValueMutator<Integer>
public BitwiseOperationBuilder withAnd(Integer aOperand)
ValueAccessor.getValue()
method.withAnd
in interface BitwiseOperationBuilder
aOperand
- The operand to be applied to the value property.BitwiseOperationBuilder
as of the Builder-Pattern to
chain multiple operations.public BitwiseOperationBuilder withOr(Integer aOperand)
ValueAccessor.getValue()
method.withOr
in interface BitwiseOperationBuilder
aOperand
- The operand to be applied to the value property.BitwiseOperationBuilder
as of the Builder-Pattern to
chain multiple operations.public BitwiseOperationBuilder withXor(Integer aOperand)
ValueAccessor.getValue()
method.withXor
in interface BitwiseOperationBuilder
aOperand
- The operand to be applied to the value property.BitwiseOperationBuilder
as of the Builder-Pattern to
chain multiple operations.public BitwiseOperationBuilder withNot()
ValueAccessor.getValue()
method.withNot
in interface BitwiseOperationBuilder
BitwiseOperationBuilder
as of the Builder-Pattern to
chain multiple operations.public boolean isMaskable(Integer aMask)
isMaskable
in interface BitwiseOperationBuilder
aMask
- The mask which's true bits are to be verified against the
value property.public boolean isTrueAt(int aPosition)
isTrueAt
in interface BitwiseOperationBuilder
aPosition
- the positionprotected static int toBitwiseAND(int aValueA, int aValueB)
aValueA
- Value A to be used.aValueB
- Value B to be used.protected static int toBitwiseNOT(int aValue)
aValue
- Value to be used.protected static int toBitwiseOR(int aValueA, int aValueB)
aValueA
- Value A to be used.aValueB
- Value B to be used.protected static int toBitwiseXOR(int aValueA, int aValueB)
aValueA
- Value A to be used.aValueB
- Value B to be used.protected static boolean isBitwiseMaskable(int aValue, int aMask)
aValue
- The value to see if the true values in the mask are also
true in the value.aMask
- The mask which's true values are to be verified against the
provided value.protected static boolean isTrueAt(int aValue, int aPos)
aValue
- The value interpreted as a bit-field.aPos
- The position of the bit-field to be tested.Copyright © 2018. All rights reserved.