|
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.Map
A map keeps (MapKey, entry object) pairs in it.
Given a MapKey, an entry/entries can be retrieved by
exact match, longest match, match, or wildcard match.
MapKey, Serialized Form| Field Summary | |
static java.lang.Class |
BEST_CLASS_FOR_LONGEST_MATCH
|
protected java.lang.Object[] |
entry
|
protected MapKey[] |
key
|
static java.lang.String |
MATCH_ALL
|
static java.lang.String |
MATCH_EXACT
|
static java.lang.String |
MATCH_LONGEST
|
static java.lang.String |
MATCH_WILDCARD
|
protected int |
size
|
| Constructor Summary | |
Map()
|
|
| Method Summary | |
void |
addEntry(MapKey key_,
java.lang.Object entry_)
Add the key-entry pair to the Map. |
boolean |
anyMatch(BitSet key_)
|
java.lang.String |
binaryRepresentation()
Prints out the content of this map and represents the keys in the binary form. |
java.lang.String |
binaryRepresentation(boolean skipLeadingZeros_)
Prints out the content of this map and represents the keys in the binary form. |
java.lang.String |
binaryRepresentation(int length_)
Prints out the content of this map and represents the keys in the binary form. |
java.lang.String |
diag()
Printout for diagnosis. |
void |
duplicate(java.lang.Object source_)
opies the content of the source_ object to this object. |
java.lang.Object |
get(BitSet bs_,
java.lang.String matchType_)
For "longest match" and "match all". |
java.lang.Object |
get(MapKey key_,
java.lang.String matchType_)
For "exact match" and "wildcard match". |
java.lang.Object[] |
getAllEntries()
|
MapKey[] |
getAllKeys()
|
static Map |
getBestImplementationForLongestMatch()
|
protected java.lang.Object |
getExactMatch(MapKey key_)
Returns the exact match. |
protected java.lang.Object |
getLongestMatch(BitSet key_)
Returns the longest match. |
protected java.lang.Object[] |
getMatches(BitSet key_)
Returns all the matches |
int |
getSize()
Returns the current size (number of entries) of the map. |
protected java.lang.Object[] |
getWildcardMatches(MapKey key_)
Returns all the wildcard matches. |
java.lang.String |
hexRepresentation()
Prints out the content of this map and represents the keys in the hex form. |
java.lang.String |
hexRepresentation(boolean skipLeadingZeros_)
Prints out the content of this map and represents the keys in the hex form. |
java.lang.String |
hexRepresentation(int length_)
Prints out the content of this map and represents the keys in the hex form. |
java.lang.String |
info()
Prints out the content of this map and represents the keys by the indices of 1's. |
java.lang.String |
numberRepresentation()
Prints out the content of this map and represents the keys in the form of long integers. |
java.lang.Object |
remove(BitSet bs_,
java.lang.String matchType_)
For "longest match" and "match all". |
java.lang.Object |
remove(MapKey key_,
java.lang.String matchType_)
For "exact match" and "wildcard match". |
void |
removeEntry(java.lang.Object entry_)
|
protected java.lang.Object |
removeExactMatch(MapKey key_)
Removes the exact match. |
protected java.lang.Object |
removeLongestMatch(BitSet key_)
Removes the longest match. |
protected java.lang.Object[] |
removeMatches(BitSet key_)
Removes all the matches |
protected java.lang.Object[] |
removeWildcardMatches(MapKey key_)
Removes all the wildcard matches. |
void |
reset()
Removes all the entries. |
| Methods inherited from class drcl.DrclObj |
clone, toString |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static java.lang.Class BEST_CLASS_FOR_LONGEST_MATCH
public static final java.lang.String MATCH_EXACT
public static final java.lang.String MATCH_LONGEST
public static final java.lang.String MATCH_ALL
public static final java.lang.String MATCH_WILDCARD
protected MapKey[] key
protected java.lang.Object[] entry
protected int size
| Constructor Detail |
public Map()
| Method Detail |
public static final Map getBestImplementationForLongestMatch()
public void reset()
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 DrclObj
public void addEntry(MapKey key_,
java.lang.Object entry_)
key_ - the key.entry_ - the entry.
public java.lang.Object get(MapKey key_,
java.lang.String matchType_)
for "longest match" and "match all".
public java.lang.Object get(BitSet bs_,
java.lang.String matchType_)
for "exact match" and "wildcard match".protected java.lang.Object getLongestMatch(BitSet key_)
key_ - the key to match.protected java.lang.Object getExactMatch(MapKey key_)
key_ - the key to match.public boolean anyMatch(BitSet key_)
key_ - the key to match.protected java.lang.Object[] getMatches(BitSet key_)
key_ - the key to match.protected java.lang.Object[] getWildcardMatches(MapKey key_)
key_ - the key to match.
public java.lang.Object remove(MapKey key_,
java.lang.String matchType_)
for "longest match" and "match all".
public java.lang.Object remove(BitSet bs_,
java.lang.String matchType_)
for "exact match" and "wildcard match".protected java.lang.Object removeLongestMatch(BitSet key_)
key_ - the key to match.protected java.lang.Object removeExactMatch(MapKey key_)
key_ - the key to match.protected java.lang.Object[] removeMatches(BitSet key_)
key_ - the key to match.protected java.lang.Object[] removeWildcardMatches(MapKey key_)
key_ - the key to match.public void removeEntry(java.lang.Object entry_)
public java.lang.Object[] getAllEntries()
public MapKey[] getAllKeys()
public int getSize()
public java.lang.String info()
public java.lang.String diag()
public java.lang.String numberRepresentation()
public java.lang.String binaryRepresentation()
public java.lang.String binaryRepresentation(boolean skipLeadingZeros_)
MapKey.binaryRepresentation(boolean).public java.lang.String binaryRepresentation(int length_)
MapKey.binaryRepresentation(int).public java.lang.String hexRepresentation()
public java.lang.String hexRepresentation(boolean skipLeadingZeros_)
MapKey.hexRepresentation(boolean).public java.lang.String hexRepresentation(int length_)
MapKey.hexRepresentation(int).
|
DRCL JavaSim API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||