|
Lvg Java 2006p Version |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgov.nih.nlm.nls.lvg.Lib.BitMaskBase
public class BitMaskBase
This class is the base class for Bit Mask operation. It's child class which inherits (extends) from this class need to:
History:
| Field Summary | |
|---|---|
static long[] |
mask_
|
protected static int |
MAX_BIT
the maximum number of bits used. |
| Constructor Summary | |
|---|---|
|
BitMaskBase()
Create a new BitMaskBase object |
|
BitMaskBase(long value)
Create a new BitMaskBase object, using a long integer value |
protected |
BitMaskBase(long value,
long allBitValue,
java.util.Vector[] bitStr)
|
protected |
BitMaskBase(long allBitValue,
java.util.Vector[] bitStr)
|
| Method Summary | |
|---|---|
boolean |
Contains(long value)
Check if current object contains a object with a given value. |
static boolean |
Contains(long container,
long value)
Check if a given container object contains a object with a given value. |
protected static long |
Enumerate(java.lang.String valueStr,
java.util.Vector[] bitStr)
Get the long value for one single name (no combine names of bits). |
boolean |
GetBitFlag(int maskIndex)
Get the bit value (true or false) at the specified index of this object |
static int |
GetBitIndex(long value)
Convert from a long value to a bit index |
protected static java.lang.String |
GetBitName(int bitValue,
int index,
java.util.Vector[] bitStr)
Get the name at index order of a specified bit (single). |
static long |
GetBitValue(int bitNum)
Get the long value of mask at a specified bit |
java.lang.String |
GetName()
Get the String value of this object |
long |
GetValue()
Get the long value of this object |
static void |
main(java.lang.String[] args)
Test driver for this class |
void |
SetBitFlag(int maskIndex,
boolean flag)
Set the bit value of the specified bit for this object |
void |
SetValue(long value)
Set the long value of htis object |
protected static java.lang.String |
ToName(long value,
long allBitValue,
java.util.Vector[] bitStr)
Get the combined bit string (abbreviation) of a specified value. |
protected static long |
ToValue(java.lang.String valueStr,
java.util.Vector[] bitStr)
Convert a combined value string to a long value. |
protected static java.util.Vector |
ToValues(long value,
int maxBitUsed)
Get a Vector include all values from the combined value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int MAX_BIT
public static long[] mask_
| Constructor Detail |
|---|
public BitMaskBase()
public BitMaskBase(long value)
protected BitMaskBase(long allBitValue,
java.util.Vector[] bitStr)
protected BitMaskBase(long value,
long allBitValue,
java.util.Vector[] bitStr)
| Method Detail |
|---|
public static long GetBitValue(int bitNum)
bitNum - the bit number that is interested
public static int GetBitIndex(long value)
value - long value to find for bit index
public static boolean Contains(long container,
long value)
container - a long value of the conatinervalue - a long value of the testing object
protected static java.util.Vector ToValues(long value,
int maxBitUsed)
value - combined value
public void SetValue(long value)
value - long value to be assignedpublic boolean GetBitFlag(int maskIndex)
maskIndex - index of the bit to find it's value
public void SetBitFlag(int maskIndex,
boolean flag)
maskIndex - index of the bit to be setflag - value of the bit to be set (true or false).public long GetValue()
public java.lang.String GetName()
public boolean Contains(long value)
value - a long value of the testing object
protected static long ToValue(java.lang.String valueStr,
java.util.Vector[] bitStr)
valueStr - names of bits for finding it's long value
protected static java.lang.String ToName(long value,
long allBitValue,
java.util.Vector[] bitStr)
value - nubmer for finding it's combined name
protected static long Enumerate(java.lang.String valueStr,
java.util.Vector[] bitStr)
valueStr - name of a bit for finding it's long value
protected static java.lang.String GetBitName(int bitValue,
int index,
java.util.Vector[] bitStr)
bitValue - bit nubmer for finding it's nameindex - the order index of the name in bitStr_[]
public static void main(java.lang.String[] args)
|
Lvg Java 2006p Version |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||