Interface PsyBitwise<T extends PsyBitwise>

Type Parameters:
T - a type of the second operand at binary operations.
All Superinterfaces:
PsyLogical<T>, PsyObject
All Known Subinterfaces:
PsyIntegral
All Known Implementing Classes:
PsyBigInteger, PsyBitArray, PsyInteger

@Type("bitwise") public interface PsyBitwise<T extends PsyBitwise> extends PsyLogical<T>
The representation of bitwise, a type of object that is an operand of bitwise operation. This interface declares methods for setting, clearing, testing of certain bits and bitwise shift.
  • Field Details

  • Method Details

    • psyClearBit

      PsyBitwise psyClearBit(PsyInteger oBit) throws PsyRangeCheckException
      Returns a bitwise whose value is equivalent to this value with the designated bit cleared.
      Parameters:
      oBit - the index of bit to clear.
      Returns:
      a bitwise whose value is equivalent to this value with the designated bit cleared.
      Throws:
      PsyRangeCheckException
    • psyFlipBit

      PsyBitwise psyFlipBit(PsyInteger oBit) throws PsyRangeCheckException
      Returns a bitwise whose value is equivalent to this value with the designated bit flipped.
      Parameters:
      oBit - the index of bit to flip.
      Returns:
      a bitwise whose value is equivalent to this value with the designated bit flipped.
      Throws:
      PsyRangeCheckException
    • psySetBit

      Returns a bitwise whose value is equivalent to this value with the designated bit set.
      Parameters:
      oBit - the index of bit to set.
      Returns:
      a bitwise whose value is equivalent to this value with the designated bit set.
      Throws:
      PsyRangeCheckException
    • psyTestBit

      PsyBoolean psyTestBit(PsyInteger oBit) throws PsyRangeCheckException
      Returns a boolean indicating if the designated bit is set.
      Parameters:
      oBit - the index of bit to test.
      Returns:
      a boolean indicating if the designated bit set.
      Throws:
      PsyRangeCheckException
    • psyBitShift

      PsyBitwise psyBitShift(PsyInteger oShift)
      Returns a bitwise whose value is equivalent to this value with bits shifted at the given distance. If the distance is negative, the left shift is preformed. If the distance is positive, the right shift is preformed. If the distance is zero, returns this.
      Parameters:
      oShift - the shift distance.
      Returns:
      a bitwise whose value is equivalent to this value with bits shifted at the given distance.