Package coneforest.psylla.core
Interface PsyBitwise<T extends PsyBitwise>
- Type Parameters:
T
- a type of the second operand at binary operations.
- All Superinterfaces:
PsyConvertableToName
,PsyConvertableToString
,PsyLogical<T>
,PsyObject
- All Known Subinterfaces:
PsyIntegral
- All Known Implementing Classes:
PsyBigInteger
,PsyBitArray
,PsyInteger
A 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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionpsyBitShift
(PsyInteger oShift) Returns abitwise
whose value is equivalent to this value with bits shifted at the given distance.psyClearBit
(PsyInteger oBit) Returns abitwise
whose value is equivalent to this value with the designated bit cleared.psyFlipBit
(PsyInteger oBit) Returns abitwise
whose value is equivalent to this value with the designated bit flipped.psySetBit
(PsyInteger oBit) Returns abitwise
whose value is equivalent to this value with the designated bit set.psyTestBit
(PsyInteger oBit) Returns aboolean
indicating if the designated bit is set.Methods inherited from interface coneforest.psylla.core.PsyLogical
psyAnd, psyNot, psyOr, psyXor
Methods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyClone, psyEq, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, toSyntaxString, typeName
-
Field Details
-
OPERATORS
-
-
Method Details
-
psyClearBit
Returns abitwise
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:
PsyErrorException
-
psyFlipBit
Returns abitwise
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:
PsyErrorException
-
psySetBit
Returns abitwise
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:
PsyErrorException
-
psyTestBit
Returns aboolean
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:
PsyErrorException
-
psyBitShift
Returns abitwise
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.
-