| java.lang.Object com.hp.hpl.jena.shared.uuid.Bits
Bits | final public class Bits (Code) | | Utilities for manipulating a bit pattern which held in a 64 bit long
(java.util.BitSet does not allow getting the pattern as a long)
author: Andy Seaborne version: $Id: Bits.java,v 1.4 2008/01/02 12:06:07 andy_seaborne Exp $ |
Field Summary | |
final public static boolean | CHECK |
Method Summary | |
final public static long | access(long bits, int start, int finish) Get the bits from start (inclusive) to finish (exclusive),
leaving them aligned in the long. | final public static long | clear(long bits, int start, int finish) | final public static long | mask(int start, int finish) | final public static long | maskZero(int start, int finish) | final public static long | pack(long bits, long value, int start, int finish) Place the value into the bit pattern between start and finish;
leaves other bits along. | final public static long | set(long bits, int bitIndex) Set the bits specificied. | final public static long | set(long bits, int start, int finish) | final public static boolean | test(long bits, boolean isSet, int bitIndex) | final public static boolean | test(long bits, long value, int start, int finish) | final public static long | unpack(long bits, int start, int finish) Extract the value packed into bits start (inclusive) and finish (exclusive),
the value is returned the low part of the returned long. | final public static long | unpack(String str, int startChar, int finishChar) Get bits from a hex string.
Parameters: str - Parameters: startChar - Index of first character (counted from the left, string style). |
CHECK | final public static boolean CHECK(Code) | | |
access | final public static long access(long bits, int start, int finish)(Code) | | Get the bits from start (inclusive) to finish (exclusive),
leaving them aligned in the long. See alio unpack, returns
the value found at that place.
|
clear | final public static long clear(long bits, int start, int finish)(Code) | | |
mask | final public static long mask(int start, int finish)(Code) | | Create a mask that has ones between bit positions start (inc) and finish (exc)
|
maskZero | final public static long maskZero(int start, int finish)(Code) | | Create a mask that has zeros between bit positions start (inc) and finish (exc)
and ones elsewhere
|
pack | final public static long pack(long bits, long value, int start, int finish)(Code) | | Place the value into the bit pattern between start and finish;
leaves other bits along.
|
set | final public static long set(long bits, int bitIndex)(Code) | | Set the bits specificied.
Parameters: bits - Pattern Parameters: bitIndex - Modified pattern |
set | final public static long set(long bits, int start, int finish)(Code) | | Set the bits from string (inc) to finish (exc) to one
Parameters: bits - Pattern Parameters: start - start (inclusive) Parameters: finish - finish (exclusive) Modified pattern |
test | final public static boolean test(long bits, boolean isSet, int bitIndex)(Code) | | |
test | final public static boolean test(long bits, long value, int start, int finish)(Code) | | |
unpack | final public static long unpack(long bits, int start, int finish)(Code) | | Extract the value packed into bits start (inclusive) and finish (exclusive),
the value is returned the low part of the returned long.
The low bit is bit zero.
|
unpack | final public static long unpack(String str, int startChar, int finishChar)(Code) | | Get bits from a hex string.
Parameters: str - Parameters: startChar - Index of first character (counted from the left, string style). Parameters: finishChar - Index after the last character (counted from the left, string style). long |
|
|