Creates a new element map with the specified identifier.

If the element map with that identifier already existed it will be removed and a new one created.

Parameter:

elementMapId

The object which identifies the element map.

DocFlex generator is able to maintain unlimited number of element maps. So, they themselves are stored in a hashtable and accessed using map identifiers as hash keys.

Therefore, any object representing a map identifier should be good enough to be used as a hashkey. That is, it should have appropriately implemented method Object.hashCode() in the implementing Java class.

The simple data types (like String and Number) do satisfy this. However, in certain situations, it might be tricky to find how to express a hashmap identifier in the form of a simple data type object. (Normally, this would involve writing some complicated expression that converts everything that identifies a hashmap into a single long string.)

The HashKey() function provides a way to solve this problem. Using it, you can create a compound hashkey object which encloses several simple ones.

For example, suppose you need to maintain lots of element maps each of which is connected with a certain element and identified with the element's ID plus a "some-methods" string (that's because you may also have a similar set of element maps connected with the same elements but representing "some-fields" instead). Then, you can create identifiers for those element maps using the following call:

HashKey(element.id, "some-methods")
Returns:
The element map identifier passed in the parameter.

See Also:

HashKey(), putElementByKey(), putElementsByKeys(), checkElementMap(), prepareElementMap(), clearElementMap(), removeElementMap()