com.alachisoft.ncache.serialization.util.SerializationBitSet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nc-serialization Show documentation
Show all versions of nc-serialization Show documentation
Internal package of Alachisoft.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.alachisoft.ncache.serialization.util;
import java.io.Serializable;
/**
* @author numan_hanif
*/
public class SerializationBitSet implements Cloneable, Serializable {
private byte _bitset;
public SerializationBitSet() {
}
public SerializationBitSet(byte bitset) {
this._bitset = bitset;
}
public byte getData() {
return _bitset;
}
public void setData(byte bitset) {
_bitset = bitset;
}
/// Bit set specific functions.
public boolean IsAnyBitSet(byte bit) {
return ((_bitset & bit) != 0);
}
public boolean IsBitSet(byte bit) {
return ((_bitset & bit) == bit);
}
public void SetBit(byte bit) {
_bitset |= bit;
}
public void UnsetBit(byte bit) {
_bitset &= (~bit & 0xff);
}
public void Set(byte bitsToSet, byte bitsToUnset) {
SetBit(bitsToSet);
UnsetBit(bitsToUnset);
}
public Object Clone() {
SerializationBitSet other = new SerializationBitSet();
other._bitset = _bitset;
return other;
}
public void Dispose() {
}
}