|
DRCL J-Sim API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectdrcl.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 masks and the masked values of that_
and this key are equal. |
| Methods inherited from class drcl.DrclObj |
clone |
| Methods inherited from class java.lang.Object |
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_ 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.
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 interface ObjectDuplicableduplicate in class DrclObjpublic boolean equals(java.lang.Object obj_)
public int hashCode()
public 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 J-Sim API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||