- 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 ContextActionContext action of thebitshiftoperator.static final ContextActionContext action of theclearbitoperator.static final ContextActionContext action of theflipbitoperator.static final ContextActionContext action of thesetbitoperator.static final ContextActionContext action of thetestbitoperator.Fields inherited from interface coneforest.psylla.core.PsyLogical
PSY_AND, PSY_NOT, PSY_OR, PSY_XORFields 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 abitwisewhose value is equivalent to this value with bits shifted at the given distance.psyClearBit(PsyInteger oBit) Returns abitwisewhose value is equivalent to this value with the designated bit cleared.psyFlipBit(PsyInteger oBit) Returns abitwisewhose value is equivalent to this value with the designated bit flipped.psySetBit(PsyInteger oBit) Returns abitwisewhose value is equivalent to this value with the designated bit set.psyTestBit(PsyInteger oBit) Returns abooleanindicating if the designated bit is set.Methods inherited from interface coneforest.psylla.core.PsyLogical
psyAnd, psyNot, psyOr, psyXorMethods 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 thebitshiftoperator. -
PSY_CLEARBIT
Context action of theclearbitoperator. -
PSY_FLIPBIT
Context action of theflipbitoperator. -
PSY_SETBIT
Context action of thesetbitoperator. -
PSY_TESTBIT
Context action of thetestbitoperator.
-
-
Method Details
-
psyClearBit
Returns abitwisewhose value is equivalent to this value with the designated bit cleared.- Parameters:
oBit- the index of bit to clear.- Returns:
- a
bitwisewhose value is equivalent to this value with the designated bit cleared. - Throws:
PsyRangeCheckException- if the index is out of range.
-
psyFlipBit
Returns abitwisewhose value is equivalent to this value with the designated bit flipped.- Parameters:
oBit- the index of bit to flip.- Returns:
- a
bitwisewhose value is equivalent to this value with the designated bit flipped. - Throws:
PsyRangeCheckException- if the index is out of range.
-
psySetBit
Returns abitwisewhose value is equivalent to this value with the designated bit set.- Parameters:
oBit- the index of bit to set.- Returns:
- a
bitwisewhose value is equivalent to this value with the designated bit set. - Throws:
PsyRangeCheckException- if the index is out of range.
-
psyTestBit
Returns abooleanindicating if the designated bit is set.- Parameters:
oBit- the index of bit to test.- Returns:
- a
booleanindicating if the designated bit set. - Throws:
PsyRangeCheckException- if the index is out of range.
-
psyBitShift
Returns abitwisewhose 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
bitwisewhose value is equivalent to this value with bits shifted at the given distance.
-