net.sourceforge.juint
Interface Bitwise<T>

Type Parameters:
T -
All Known Implementing Classes:
Int16, Int32, Int8, UInt16, UInt32, UInt8

public interface Bitwise<T>

Bitwise operations.


Method Summary
 T addBitmask(T bitmask)
          Sets the bits in the given bitmask.
 T and(T number)
          Logical and.
 boolean hasBitmask(T bitmask)
          Determines if this number has the given bitmask.
 T not()
          Logical not.
 T or(T number)
          Logical or.
 T removeBitmask(T bitmask)
          Unsets the bits in the given bitmask.
 T xor(T number)
          Logical xor.
 

Method Detail

and

T and(T number)
Logical and.

Parameters:
number -
Returns:
the result of the and

or

T or(T number)
Logical or.

Parameters:
number -
Returns:
the result of the or

xor

T xor(T number)
Logical xor.

Parameters:
number -
Returns:
the result of the xor

not

T not()
Logical not.

Returns:
the result of the not

hasBitmask

boolean hasBitmask(T bitmask)
Determines if this number has the given bitmask.

Parameters:
bitmask -
Returns:
true if the number has the bitmask; false otherwise

addBitmask

T addBitmask(T bitmask)
Sets the bits in the given bitmask.

Parameters:
bitmask -
Returns:
the number with the bits set

removeBitmask

T removeBitmask(T bitmask)
Unsets the bits in the given bitmask.

Parameters:
bitmask -
Returns:
the number with the bits unset