|
DRCL JavaSim API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--drcl.DrclObj
|
+--drcl.data.MapKey
MapKey is a pair of value and mask BitSets.
A MapKey matches a BitSet if the value masked
from the bitset by the mask of the key is equal to the masked value of the key.
Also two keys are matched exactly if both the values and masks are matched.
A key is said to be matched with the other key in the wildcard manner if
the value masked from the masked value of the first key by the mask of the second key
is equal to the value masked from the masked value of the second key by the mask of the
first key.
BitSet,
Map, Serialized Form| Field Summary | |
BitSet |
mask
|
BitSet |
value
|
| Constructor Summary | |
MapKey()
|
|
MapKey(BitSet mask_,
BitSet value_)
Creates an MapKey given mask and value. |
|
MapKey(long[] mask_,
long[] value_)
Creates an MapKey given mask and value as arrays of long integers. |
|
MapKey(long mask_,
long value_)
Creates an MapKey given mask and value as long integers. |
|
| Method Summary | |
java.lang.String |
binaryRepresentation()
Returns the binary representation of this map key. |
java.lang.String |
binaryRepresentation(boolean skipLeadingZeros_)
Returns the binary representation of this map key. |
java.lang.String |
binaryRepresentation(int length_)
Returns the binary representation of the value and the mask of the map key in the specified number of binary characters. |
void |
duplicate(java.lang.Object source_)
opies the content of the source_ object to this object. |
boolean |
equals(java.lang.Object obj_)
|
boolean |
exactMatch(MapKey that_)
Returns true only if the masks and the masked values of that_ and this key
are equal. |
BitSet |
getMask()
|
BitSet |
getValue()
|
int |
hashCode()
|
java.lang.String |
hexRepresentation()
Returns the hex representation of this map key. |
java.lang.String |
hexRepresentation(boolean skipLeadingZeros_)
Returns the hex representation of this map key. |
java.lang.String |
hexRepresentation(int length_)
Returns the hex representation of the value and the mask of the map key in the specified number of hex characters. |
boolean |
match(BitSet bs_)
Masks the value of bs_ with the mask of this MapKey
and returns true if the masked value is equal to the masked value of this key. |
java.lang.String |
numberRepresentation()
Returns the long integer representation of this map key. |
void |
set(BitSet mask_,
BitSet value_)
Set this MapKey with the given mask and value. |
void |
setMask(BitSet bs_)
|
void |
setValue(BitSet bs_)
|
java.lang.String |
toString()
Prints out the value and the mask of this map key by the set of indices of the bits of 1's in the value and the mask. |
boolean |
wildcardMatch(MapKey that_)
Returns true if the values of that_ and this key are equal under that_ key's
mask. |
| Methods inherited from class drcl.DrclObj |
clone |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public BitSet mask
public BitSet value
| Constructor Detail |
public MapKey()
public MapKey(BitSet mask_,
BitSet value_)
MapKey given mask and value.mask_ - mask.value_ - value.
public MapKey(long mask_,
long value_)
MapKey given mask and value as long integers.mask_ - mask.value_ - value.
public MapKey(long[] mask_,
long[] value_)
MapKey given mask and value as arrays of long integers.
The arrays are first converted to bitsets.
The least significant bit of a bit set is at bit 0 of element 0 in the array.mask_ - mask.value_ - value.| Method Detail |
public void set(BitSet mask_,
BitSet value_)
MapKey with the given mask and value.mask_ - mask.value_ - value.public void setValue(BitSet bs_)
public BitSet getValue()
public void setMask(BitSet bs_)
public BitSet getMask()
public boolean match(BitSet bs_)
bs_ with the mask of this MapKey
and returns true if the masked value is equal to the masked value of this key.that_ - the key to be matched.that_ using the mask of this key
is equal to the masked value of this key.public boolean exactMatch(MapKey that_)
that_ and this key
are equal.that_ - the key to be matched.that_ and this key
are equal.public boolean wildcardMatch(MapKey that_)
that_ and this key are equal under that_ key's
mask.that_ - the key to be matched.that_ and this key
are equal.public void duplicate(java.lang.Object source_)
DrclObjsource_ object to this object.
he subclass must implement this method to realize DrclObj.clone().duplicate in class DrclObjpublic boolean equals(java.lang.Object obj_)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class DrclObjBitSet.toString().public java.lang.String numberRepresentation()
public java.lang.String binaryRepresentation()
public java.lang.String binaryRepresentation(boolean skipLeadingZeros_)
skipLeadingZeros_ - if true, the leading zeros in the resulting binary
represenation is not printed.BitSet.binaryRepresentation(boolean).public java.lang.String binaryRepresentation(int length_)
length_ - expected number of binary characters.BitSet.binaryRepresentation(int).public java.lang.String hexRepresentation()
public java.lang.String hexRepresentation(boolean skipLeadingZeros_)
skipLeadingZeros_ - if true, the leading zeros in the resulting binary
represenation is not printed.BitSet.hexRepresentation(boolean).public java.lang.String hexRepresentation(int length_)
length_ - expected number of hex characters.BitSet.hexRepresentation(int).
|
DRCL JavaSim API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||