|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthicosim.control.utils.BitUtils
public class BitUtils
Hilfsklasse, welche Methoden fuer Bitoperationen bereitstellt. Class which provides methods for bitmanipulation.
Constructor Summary | |
---|---|
BitUtils()
|
Method Summary | |
---|---|
static long |
binary2Decimal(java.lang.String binaryString)
convert a binaryString to a decimal number |
static int |
checkBitsRange(int instr,
int start,
int end,
int check)
|
static int |
clearBit(int n,
int pos)
|
static java.lang.String |
convert(java.lang.Integer number,
Numeratives numeratives,
boolean grouped)
This method converts an Integer-Object from the decimal numerative into other numeratives and returns the result as a String-Object. |
static java.lang.String |
convert(java.lang.Long number,
Numeratives numeratives,
boolean grouped)
|
static int |
flipBit(int n,
int pos)
|
static int |
fourBytesToOneInteger(int a,
int b,
int c,
int d)
this method converts four bytes to one integer. |
static int |
hex2Decimal(java.lang.String hexWord)
convert a hexadecimal string to a decimal number |
static boolean |
isXPot(int pot,
int N)
This methos checks if the number N is a pot of param pot |
static int |
octalToDecimal(java.lang.String octalNumberAsString)
This method converts an octal number, which is passed as a String-Object "octalNumberAsString", into a decimal number and returns it as an Integer-Object. |
static long |
pot(long x,
long n)
|
static int |
setBit(int n,
int pos)
|
static boolean |
testBit(int n,
int pos)
|
int |
twosComplement(int x)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BitUtils()
Method Detail |
---|
public static int setBit(int n, int pos)
public static int clearBit(int n, int pos)
public static int flipBit(int n, int pos)
public static boolean testBit(int n, int pos)
public static int checkBitsRange(int instr, int start, int end, int check)
instr
- int wert zum testenstart
- start positionend
- letzte positioncheck
- art des bit zum testen 0,1
public int twosComplement(int x)
public static java.lang.String convert(java.lang.Integer number, Numeratives numeratives, boolean grouped)
-
- Integer number-
- Numeratives numeratives-
- boolean grouped
public static java.lang.String convert(java.lang.Long number, Numeratives numeratives, boolean grouped)
public static boolean isXPot(int pot, int N)
pot
- N
-
public static int hex2Decimal(java.lang.String hexWord)
hexWord
- ==> for instance: ff -> returns 255
public static int octalToDecimal(java.lang.String octalNumberAsString)
String
- octalNumberAsString
public static long binary2Decimal(java.lang.String binaryString)
binaryString
- ==> for instance: 00000000100000001000000010000001 --> return:
8421505 ==> 10000010000000000000000000000000 --> return:
-2113929216
public static long pot(long x, long n)
public static int fourBytesToOneInteger(int a, int b, int c, int d)
a
- b
- c
- d
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |