- 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
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final ContextAction
Context action of thebitshift
operator.static final ContextAction
Context action of theclearbit
operator.static final ContextAction
Context action of theflipbit
operator.static final ContextAction
Context action of thesetbit
operator.static final ContextAction
Context action of thetestbit
operator.Fields inherited from interface coneforest.psylla.core.PsyLogical
PSY_AND, PSY_NOT, PSY_OR, PSY_XOR
Fields inherited from interface coneforest.psylla.core.PsyObject
PSY_CLONE, PSY_EQ, PSY_HASHCODE, PSY_INSTANCEOF, PSY_NE, PSY_TONAME, PSY_TOSTRING, PSY_TYPE
-
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
-
PSY_BITSHIFT
Context action of thebitshift
operator. -
PSY_CLEARBIT
Context action of theclearbit
operator. -
PSY_FLIPBIT
Context action of theflipbit
operator. -
PSY_SETBIT
Context action of thesetbit
operator. -
PSY_TESTBIT
Context action of thetestbit
operator.
-
-
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:
PsyRangeCheckException
-
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:
PsyRangeCheckException
-
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:
PsyRangeCheckException
-
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:
PsyRangeCheckException
-
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.
-