|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmesquite.lib.Bits
public class Bits
Bits - an object to contain and manage a field of booleans. This was invented before the Java Bitfield was discovered. Perhaps not needed.
| Constructor Summary | |
|---|---|
Bits(int numBits)
|
|
| Method Summary | |
|---|---|
static boolean[] |
addParts(boolean[] d,
int starting,
int num)
Inserts num (cleared) bits just after bit "starting" |
void |
addParts(int starting,
int num)
Inserts num (cleared) bits just after bit "starting" |
static boolean[][] |
addRows(boolean[][] d,
int starting,
int num)
|
boolean |
anyBitsOn()
|
void |
clearAllBits()
|
void |
clearBit(int whichBit)
|
Bits |
cloneBits()
|
void |
copyBits(Bits b)
|
static boolean[] |
deleteParts(boolean[] values,
int starting,
int num)
|
void |
deleteParts(int starting,
int num)
Removes num bits starting with and incuding bit "starting" |
static boolean[][] |
deleteRows(boolean[][] d,
int starting,
int num)
|
boolean |
equals(Bits other)
|
int |
firstBitOn()
|
java.lang.String |
getListOfBitsOn(int offset)
returns a string listing the bits on. |
java.lang.String |
getName()
|
NameReference |
getNameReference()
|
int |
getNumInts()
|
int |
getSize()
|
boolean |
isBitOn(int whichBit)
|
static boolean |
isBitOn(int[] bits,
int whichBit)
|
static void |
moveColumns(boolean[][] d,
int starting,
int num,
int justAfter)
|
void |
moveParts(int starting,
int num,
int justAfter)
|
static void |
moveRows(boolean[][] d,
int starting,
int num,
int justAfter)
|
int |
nextBit(int startBit,
boolean on)
returns the next bit, starting a startBit, that has the same value as "on" |
int |
numBitsOn()
|
int |
numBitsOnPlural()
|
boolean |
oneBitOn(MesquiteInteger single)
Returns true iff exactly one bit is on. |
void |
resetSize(int newNumBits)
|
static boolean[] |
reverseBooleanArray(boolean[] d)
Reverses the elements of a boolean array |
void |
setAllBits()
|
void |
setBit(int whichBit)
|
void |
setBit(int[] a,
int whichBit)
|
void |
setBit(int whichBit,
boolean on)
|
void |
setNameReference(NameReference nr)
|
static void |
swapColumns(boolean[][] d,
int first,
int second)
|
void |
swapParts(int first,
int second)
|
void |
swapValues(int i,
int j)
|
java.lang.String |
toString()
|
static java.lang.String |
toString(boolean[] bits)
|
static java.lang.String |
toString(byte s)
converts passed int to string, as its bits representation. |
static java.lang.String |
toString(int s)
converts passed int to string, as its bits representation. |
static java.lang.String |
toString(int[] bits)
|
static java.lang.String |
toString(long s)
converts passed long to string, as its bits representation. |
static java.lang.String |
toString(short s)
converts passed int to string, as its bits representation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Bits(int numBits)
| Method Detail |
|---|
public int getSize()
public int getNumInts()
public Bits cloneBits()
public void copyBits(Bits b)
public void setNameReference(NameReference nr)
public NameReference getNameReference()
public java.lang.String getName()
getName in interface Listablepublic void resetSize(int newNumBits)
public void addParts(int starting,
int num)
public void deleteParts(int starting,
int num)
public void swapParts(int first,
int second)
public void moveParts(int starting,
int num,
int justAfter)
public int numBitsOn()
public int numBitsOnPlural()
public void clearAllBits()
public void setAllBits()
public void clearBit(int whichBit)
public void setBit(int[] a,
int whichBit)
public void setBit(int whichBit)
public void setBit(int whichBit,
boolean on)
public void swapValues(int i,
int j)
public boolean equals(Bits other)
public boolean isBitOn(int whichBit)
public static boolean isBitOn(int[] bits,
int whichBit)
public int nextBit(int startBit,
boolean on)
public boolean anyBitsOn()
public int firstBitOn()
public boolean oneBitOn(MesquiteInteger single)
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getListOfBitsOn(int offset)
public static void moveColumns(boolean[][] d,
int starting,
int num,
int justAfter)
public static void swapColumns(boolean[][] d,
int first,
int second)
public static void moveRows(boolean[][] d,
int starting,
int num,
int justAfter)
public static boolean[][] addRows(boolean[][] d,
int starting,
int num)
public static boolean[][] deleteRows(boolean[][] d,
int starting,
int num)
public static boolean[] addParts(boolean[] d,
int starting,
int num)
public static boolean[] deleteParts(boolean[] values,
int starting,
int num)
public static boolean[] reverseBooleanArray(boolean[] d)
public static java.lang.String toString(int[] bits)
public static java.lang.String toString(boolean[] bits)
public static java.lang.String toString(byte s)
public static java.lang.String toString(short s)
public static java.lang.String toString(int s)
public static java.lang.String toString(long s)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||