Terrier IR Platform
2.2.1

uk.ac.gla.terrier.compression
Class BitUtilities

java.lang.Object
  extended by uk.ac.gla.terrier.compression.BitUtilities

public class BitUtilities
extends java.lang.Object

Utility methods for use in the BitFile classes.

Since:
2.0
Version:
$Revision: 1.4 $
Author:
Craig Macdonald

Field Summary
static int[] MSB_BYTES
          Array of output of mostSignficantBit(byte) for quicker lookups
 
Constructor Summary
BitUtilities()
           
 
Method Summary
static int mostSignficantBit_Loop(int x)
          Returns the most significant bit for any positive integer, 0 for -1.
static int mostSignificantBit(byte x)
          Returns the most significant bit for any byte value.
static int mostSignificantBit(int x)
          Returns the most significant bit for any positive integer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MSB_BYTES

public static final int[] MSB_BYTES
Array of output of mostSignficantBit(byte) for quicker lookups

Constructor Detail

BitUtilities

public BitUtilities()
Method Detail

mostSignficantBit_Loop

public static int mostSignficantBit_Loop(int x)
Returns the most significant bit for any positive integer, 0 for -1. Computed by iteration


mostSignificantBit

public static int mostSignificantBit(int x)
Returns the most significant bit for any positive integer. 0 for -1. Computed by hard-coded binary search.


mostSignificantBit

public static int mostSignificantBit(byte x)
Returns the most significant bit for any byte value. 0 gives MSB -1.


Terrier IR Platform
2.2.1

Terrier Information Retrieval Platform 2.2.1. Copyright 2004-2008 University of Glasgow