org.hsqldb.map
Class BitMap
- java.lang.Object
-
- org.hsqldb.map.BitMap
-
public class BitMap extends java.lang.ObjectImplementation of a bit map of any size, together with static methods to manipulate int, byte and byte[] values as bit maps.- Since:
- 1.8.0
-
-
Constructor Summary
Constructors Constructor and Description BitMap(int[] map)BitMap(int initialCapacity, boolean extend)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static byte[]and(byte[] a, byte[] b)static voidand(byte[] map, int pos, byte source, int count)AND count bits from source with map contents starting at posintcountSet(int pos, int count)intcountSetBits()intcountSetBitsEnd()Only for word boundary map sizestatic intcountSetBitsLow(int map)count the set bits at the low endintget(int pos)byte[]getBytes()int[]getIntArray()static booleanhasAnyBitSet(byte[] map)static booleanisSet(byte[] map, int pos)static booleanisSet(byte map, int pos)booleanisSet(int pos)static booleanisSet(int map, int pos)static byte[]leftShift(byte[] map, int shiftBits)static byte[]not(byte[] a)static byte[]or(byte[] a, byte[] b)static voidor(byte[] map, int pos, byte source, int count)OR count bits from source with map contents starting at posstatic voidoverlay(byte[] map, int pos, byte source, int count)overlay count bits from source on map contents starting at posvoidreset()Resets to blank with original capacitystatic voidset(byte[] map, int pos)static byteset(byte map, int pos)intset(int pos)Sets pos and returns old valuestatic intset(int map, int pos)static intsetByte(int map, byte value, int pos)copy the byte value into the map at given position (0, 24)voidsetRange(int pos, int count)voidsetSize(int size)intsetValue(int pos, boolean set)intsize()static voidunset(byte[] map, int pos)intunset(int pos)Unsets pos and returns old valuestatic intunset(int map, int pos)voidunsetRange(int pos, int count)static byte[]xor(byte[] a, byte[] b)
-
-
-
Constructor Detail
-
BitMap
public BitMap(int initialCapacity, boolean extend)
-
BitMap
public BitMap(int[] map)
-
-
Method Detail
-
size
public int size()
-
setSize
public void setSize(int size)
-
reset
public void reset()
Resets to blank with original capacity
-
setRange
public void setRange(int pos, int count)
-
unsetRange
public void unsetRange(int pos, int count)
-
setValue
public int setValue(int pos, boolean set)
-
set
public int set(int pos)
Sets pos and returns old value
-
unset
public int unset(int pos)
Unsets pos and returns old value
-
get
public int get(int pos)
-
isSet
public boolean isSet(int pos)
-
countSet
public int countSet(int pos, int count)
-
countSetBits
public int countSetBits()
-
countSetBitsEnd
public int countSetBitsEnd()
Only for word boundary map size
-
getIntArray
public int[] getIntArray()
-
getBytes
public byte[] getBytes()
-
countSetBitsLow
public static int countSetBitsLow(int map)
count the set bits at the low end
-
setByte
public static int setByte(int map, byte value, int pos)copy the byte value into the map at given position (0, 24)
-
set
public static int set(int map, int pos)
-
set
public static byte set(byte map, int pos)
-
unset
public static int unset(int map, int pos)
-
isSet
public static boolean isSet(int map, int pos)
-
isSet
public static boolean isSet(byte map, int pos)
-
isSet
public static boolean isSet(byte[] map, int pos)
-
unset
public static void unset(byte[] map, int pos)
-
set
public static void set(byte[] map, int pos)
-
and
public static void and(byte[] map, int pos, byte source, int count)AND count bits from source with map contents starting at pos
-
or
public static void or(byte[] map, int pos, byte source, int count)OR count bits from source with map contents starting at pos
-
overlay
public static void overlay(byte[] map, int pos, byte source, int count)overlay count bits from source on map contents starting at pos
-
and
public static byte[] and(byte[] a, byte[] b)
-
or
public static byte[] or(byte[] a, byte[] b)
-
xor
public static byte[] xor(byte[] a, byte[] b)
-
not
public static byte[] not(byte[] a)
-
hasAnyBitSet
public static boolean hasAnyBitSet(byte[] map)
-
leftShift
public static byte[] leftShift(byte[] map, int shiftBits)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG