From charlesreid1

Implementation and Functionality

Some absolute basic functionality that should be provided:

  • m[k] or m.get(k) - get the value v associated with key k in map m, returns key error
  • m[k] = v or m.set(k,v) or m.put(k,v) - set the value v associated with key k in map m
  • del m[k] or m.remove(k) - remove the element with key k in map m
  • len(m) or m.size() - return the number of elements (unique keys) in the map
  • iter(m) - iterator over keys of map


Notes

Base map class. Maps are essentially key-value data structures - you pass in a key, you get back a value.

In the Java Collections framework, the Map class is the highest-level abstract class - it is actually an interface, not a class.

Java API Documentation for Map class: http://docs.oracle.com/javase/8/docs/api/java/util/Map.html

The base type Map defines a large number of methods - see Maps/ADT for the full list.


Flags