public class BitMask
extends java.lang.Object
implements java.lang.Cloneable
Constructor and Description |
---|
BitMask()
Construct a new BitMask with value of 0
|
BitMask(int m)
Construct a BitMask from an integer
|
Modifier and Type | Method and Description |
---|---|
BitMask |
and(BitMask mask)
Performs a logical AND of this mask with the argument mask.
|
BitMask |
clear()
Sets all of the bits to 0
Returns this BitMask.
|
java.lang.Object |
clone()
Cloning a BitMask produces a new BitMask that is equal to it.
|
boolean |
equals(java.lang.Object obj)
Equals
|
int |
hashCode()
Hash Code.
|
BitMask |
invert()
Inverts all of the bits of this BitMask.
|
boolean |
isClear()
Is the mask clear?
That is, is any bit set?
Returns true if it is, false otherwise.
|
boolean |
isSet(int bitIndex)
Is the bit at the specified index set?
Returns true if it is, false otherwise.
|
BitMask |
or(BitMask mask)
Performs a logical OR of this mask with the argument mask.
|
BitMask |
set(int bitIndex)
Sets the bit at the specified index.
|
java.lang.String |
toString()
To String
|
BitMask |
unset(int bitIndex)
Unsets the bit at the specified index.
|
BitMask |
xor(BitMask mask)
Performs a logical XOR of this mask with the argument mask.
|
public BitMask()
public BitMask(int m)
public BitMask and(BitMask mask)
public BitMask or(BitMask mask)
public BitMask xor(BitMask mask)
public BitMask set(int bitIndex)
public BitMask unset(int bitIndex)
public boolean isSet(int bitIndex)
public BitMask clear()
public boolean isClear()
public BitMask invert()
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
User Space Routing 0.10.3