org.jboss.lang
Class NumberHelper

java.lang.Object
  extended by org.jboss.lang.NumberHelper

public class NumberHelper
extends Object

Implementations of java.lang.Integer and other Number methods added in jdk5 Code from http://www.hackersdelight.org/HDcode.htm

Version:
$Revision: 227 $
Author:
Elias Ross

Constructor Summary
NumberHelper()
           
 
Method Summary
static int bitCount(int i)
          http://www.hackersdelight.org/HDcode/pop.c
static int bitCount(long i)
           
static int highestOneBit(int i)
          http://www.hackersdelight.org/HDcode/flp2.c
static long highestOneBit(long i)
           
static int lowestOneBit(int i)
          http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=bitManipulation
static long lowestOneBit(long i)
           
static int numberOfLeadingZeros(int i)
          http://www.hackersdelight.org/HDcode/nlz.c
static int numberOfLeadingZeros(long i)
           
static int numberOfTrailingZeros(int i)
          http://www.hackersdelight.org/HDcode/ntz.c
static int numberOfTrailingZeros(long i)
           
static int reverse(int i)
          http://www.hackersdelight.org/HDcode/reverse.c
static long reverse(long i)
           
static int reverseBytes(int i)
           
static long reverseBytes(long i)
           
static int rotateLeft(int i, int distance)
           
static long rotateLeft(long i, int distance)
           
static int rotateRight(int i, int distance)
           
static long rotateRight(long i, int distance)
           
static int signum(int i)
           
static int signum(long i)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumberHelper

public NumberHelper()
Method Detail

highestOneBit

public static int highestOneBit(int i)
http://www.hackersdelight.org/HDcode/flp2.c


lowestOneBit

public static int lowestOneBit(int i)
http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=bitManipulation


numberOfLeadingZeros

public static int numberOfLeadingZeros(int i)
http://www.hackersdelight.org/HDcode/nlz.c


numberOfTrailingZeros

public static int numberOfTrailingZeros(int i)
http://www.hackersdelight.org/HDcode/ntz.c


bitCount

public static int bitCount(int i)
http://www.hackersdelight.org/HDcode/pop.c


rotateLeft

public static int rotateLeft(int i,
                             int distance)

rotateRight

public static int rotateRight(int i,
                              int distance)

reverse

public static int reverse(int i)
http://www.hackersdelight.org/HDcode/reverse.c


signum

public static int signum(int i)

reverseBytes

public static int reverseBytes(int i)

highestOneBit

public static long highestOneBit(long i)

lowestOneBit

public static long lowestOneBit(long i)

numberOfLeadingZeros

public static int numberOfLeadingZeros(long i)

numberOfTrailingZeros

public static int numberOfTrailingZeros(long i)

bitCount

public static int bitCount(long i)

rotateLeft

public static long rotateLeft(long i,
                              int distance)

rotateRight

public static long rotateRight(long i,
                               int distance)

reverse

public static long reverse(long i)

signum

public static int signum(long i)

reverseBytes

public static long reverseBytes(long i)


Copyright © 2005-2007 JBoss, a division of Red Hat, Inc. All Rights Reserved.