Pages

Tuesday, 11 February 2014

MapIterator and MapEnumerator in ax


Map enumerators start before the first element in the list. You must call the  MapEnumerator.moveNext method to make it point to the first element in the list.

It is better to use MapEnumeratorClass  than MapIterator. Map iterators and the maps over which they iterate must be on the same Client/Server side. If you use MapIterator, and code is marked as Called from, it is possible that the map and the iterator will end up on different tiers, and the code will fail. If you use  MapEnumerator, the enumerator is automatically created on the same tier as the map. Also, to move to the next item in a map you must explicitly call the more and next methods if you are using a map iterator. If you use  MapEnumerator, you only have to call moveNext method.

The sequence in which the elements are inserted does not determine the order in which they occur. The order is defined by the ordering of the elements. Elements with lower keys appear before elements with higher keys. The usual ordering for the types is used. However, if the keys are objects, the addresses of the objects are used to supply the ordering and no specific ordering may consequently be inferred. The addresses of the objects are transient by nature.


The only situation where you have to use a map iterator is when you want to delete items from a list (use the MapIterator.delete method).

No comments:

Post a Comment