Interface BitwiseOperationBuilder

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.refcodes.mixin.ValueAccessor

        org.refcodes.mixin.ValueAccessor.ValueBuilder<V extends Object,B extends org.refcodes.mixin.ValueAccessor.ValueBuilder<V,B>>, org.refcodes.mixin.ValueAccessor.ValueMutator<V extends Object>, org.refcodes.mixin.ValueAccessor.ValueProperty<V extends Object>
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      static BitwiseOperationBuilder build​()
      This is a convenience method for easily instantiating the according builder.
      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.
      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.
      default BitwiseOperationBuilder withValue​(Integer aValue)
      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.
      • Methods inherited from interface org.refcodes.mixin.ValueAccessor

        getValue, getValueOr
      • Methods inherited from interface org.refcodes.mixin.ValueAccessor.ValueMutator

        setValue
    • Method Detail

      • withAnd

        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.
        Parameters:
        aOperand - The operand to be applied to the value property.
        Returns:
        The BitwiseOperationBuilder as of the Builder-Pattern to chain multiple operations.
      • withOr

        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.
        Parameters:
        aOperand - The operand to be applied to the value property.
        Returns:
        The BitwiseOperationBuilder as of the Builder-Pattern to chain multiple operations.
      • withXor

        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.
        Parameters:
        aOperand - The operand to be applied to the value property.
        Returns:
        The BitwiseOperationBuilder as of the Builder-Pattern to chain multiple operations.
      • withNot

        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.
        Returns:
        The BitwiseOperationBuilder as of the Builder-Pattern to chain multiple operations.
      • isMaskable

        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"). If this is the case true is returned. Else false is returned. Additionally bits set in the value property are not considered in the result. The bit-length of the mask may not be the same as the bit-length of the value.
        Parameters:
        aMask - The mask which's true bits are to be verified against the value property.
        Returns:
        True in case the value property is maskable by the given mask.
      • isTrueAt

        boolean isTrueAt​(int aPosition)
        Checks if is true at.
        Parameters:
        aPosition - the position
        Returns:
        true, if is true at
      • build

        static BitwiseOperationBuilder build​()
        This is a convenience method for easily instantiating the according builder.
        Returns:
        an instance (using a default implementation) of this builder