|
jbarrier | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.bonn.cs.net.jbarrier.util.Utils
public class Utils
Utility functions for computing powers of two.
Constructor Summary | |
---|---|
Utils()
|
Method Summary | |
---|---|
static boolean |
isPowerOfTwo(int k)
Checks whether the provided integer is a power of two. |
static int |
nextHigherPowerOfTwo(int k)
Computes the next higher power of two of the provided integer. |
static int |
powerOfTwo(int n)
Computes the n -th integer power of two. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Utils()
Method Detail |
---|
public static int nextHigherPowerOfTwo(int k)
k
- the provided integer
k
public static int powerOfTwo(int n)
n
-th integer power of two.
n
- the provided integer
n
-th power of twopublic static boolean isPowerOfTwo(int k)
k
- the provided integer
true
if the provided integer is a power of two,
otherwise false
|
jbarrier | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |