|
jmce - 1_02 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjmce.sim.cpu.Binary
public class Binary
Sample class to deal with binary number.
This class make easy set / reset single bit in one integer number.
Constructor Summary | |
---|---|
Binary()
Default constructor. |
|
Binary(int n)
Constructor with specific number |
Method Summary | |
---|---|
boolean |
getBit(int b)
Return the specified bit. |
int |
getValue()
Return the current value. |
void |
setBit(int b,
boolean v)
Set a value for specific bit. |
void |
setValue(int n)
Set the current value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Binary()
public Binary(int n)
Method Detail |
---|
public void setValue(int n)
public int getValue()
public void setBit(int b, boolean v)
b
- - Bit number 0 .. 31v
- - Bit value (true = 1, false = 0)public boolean getBit(int b)
b
- - Number of bit 0 .. n
|
jmce - 1_02 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |