Objectives :
- Maps provides one-o-one mapping with UNIQUE key and values.
- Maps differ from Set having key and value in pair where as Set
supports only value.
- Several classes implements Maps.
- Hastable :
- HasMap: is unsynchronized and allows null keys and values.
- HashMap class uses a hastable to implement the Map
Inteface.
- supports operations like get() and put()
- has four constructors : HashMap(), HasMap(Map m),
HasMap(int capacity), HasMap(int capacity, float fillRatio)
- TreeMap
- Sorted Maps : Extends map and maintains its key in sorted order
- hashing :
- A hash table stores information by using a mechanism called
hasing
- A scheme uses to one hash to locate first -cell in a
HasTable. If the cell is taken the scheme will fetch successive
cells.
- A key is used to determine the unique value called
hasCode
- hasCodes are indexed
|