DRCL JavaSim API

drcl.data
Class RadixMap

java.lang.Object
  |
  +--drcl.DrclObj
        |
        +--drcl.data.Map
              |
              +--drcl.data.RadixMap
All Implemented Interfaces:
java.lang.Cloneable, ObjectDuplicable, java.io.Serializable

public class RadixMap
extends 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.

See Also:
MapKey, Serialized Form

Inner Class Summary
protected  class RadixMap.Radix_mask
           
protected  class RadixMap.Radix_node
           
 
Fields inherited from class drcl.data.Map
BEST_CLASS_FOR_LONGEST_MATCH, entry, key, MATCH_ALL, MATCH_EXACT, MATCH_LONGEST, MATCH_WILDCARD, size
 
Constructor Summary
RadixMap()
           
 
Method Summary
 void addEntry(MapKey key_, java.lang.Object entry_)
          Add the key-entry pair to the Map.
 java.lang.String diag()
          Printout for diagnosis.
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 removeExactMatch(MapKey key_)
          Removes the exact match.
protected  java.lang.Object removeLongestMatch(BitSet key_)
          Removes the longest match.
 void reset()
          Removes all the entries.
 
Methods inherited from class drcl.data.Map
anyMatch, binaryRepresentation, binaryRepresentation, binaryRepresentation, duplicate, get, get, getAllEntries, getAllKeys, getBestImplementationForLongestMatch, getMatches, getSize, getWildcardMatches, hexRepresentation, hexRepresentation, hexRepresentation, info, numberRepresentation, remove, remove, removeEntry, removeMatches, removeWildcardMatches
 
Methods inherited from class drcl.DrclObj
clone, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RadixMap

public RadixMap()
Method Detail

reset

public void reset()
Removes all the entries.
Overrides:
reset in class Map

getLongestMatch

protected java.lang.Object getLongestMatch(BitSet key_)
Description copied from class: Map
Returns the longest match.
Overrides:
getLongestMatch in class Map
Following copied from class: drcl.data.Map
Parameters:
key_ - the key to match.
Returns:
the entry with the key matching the argument with largest number of bits.

getExactMatch

protected java.lang.Object getExactMatch(MapKey key_)
Description copied from class: Map
Returns the exact match.
Overrides:
getExactMatch in class Map
Following copied from class: drcl.data.Map
Parameters:
key_ - the key to match.
Returns:
the entry with the key exactly matching the argument.

removeLongestMatch

protected java.lang.Object removeLongestMatch(BitSet key_)
Removes the longest match. Repeate the action done in getLongestMatch, but in the final step free the entry and delete the node from radix-tree
Overrides:
removeLongestMatch in class Map
Parameters:
key_ - the key to match.
Returns:
the entry with the key matching the argument with largest number of bits.

removeExactMatch

protected java.lang.Object removeExactMatch(MapKey key_)
Description copied from class: Map
Removes the exact match.
Overrides:
removeExactMatch in class Map
Following copied from class: drcl.data.Map
Parameters:
key_ - the key to match.
Returns:
the entry with the key exactly matching the argument.

addEntry

public void addEntry(MapKey key_,
                     java.lang.Object entry_)
Add the key-entry pair to the Map. No check is done for duplicate keys.
Overrides:
addEntry in class Map
Parameters:
key_ - the key.
entry_ - the entry.

diag

public java.lang.String diag()
Description copied from class: Map
Printout for diagnosis.
Overrides:
diag in class Map

DRCL JavaSim API

Copyright © 2001 - DRCL, OSU     ~ Back to JavaSim Home ~