On 03/19/09 22:58, Frank Schönheit - Sun Microsystems Germany wrote:
being in need of some generic map interface in UNO, I suggest
introducing the attached css.container.XMap interface in module udkapi.
...
Since the interface is a little bit bigger than the canonical
"has/insert/remove" triple, I also thought about introducing a
css.container.Map default implementation,

FYI: the latest versions:
http://svn.services.openoffice.org/ooo/cws/dba32b/udkapi/com/sun/star/container/XMap.idl
http://svn.services.openoffice.org/ooo/cws/dba32b/udkapi/com/sun/star/container/Map.idl

You still have the chance to veto this (if you have a good reasoning :)
before the CWS will be finalized ...

Seeing that you want to put that into udkapi, I'll have a closer look:  ;)

- Parameter names starting with an underscore are not valid.

- KeySet: How is "inserting new elements into the key set is not supported" handled (e.g., is it specified what exception gets raised)?

- KeySet.has, KeySet.remove, containsKey, containsValue, get, put, remove: You need to clarify how to compare the involved values for equality.

- Values: "The map and the value collection are linked, in that changes in the map are reflected in the value collection, too." and "If you modify the map while an enumeration of values is running, the behavior of the enumeration is undefined." look like they are at odds with each other. What exactly is meant with "while an enumeration of values is running"?

- getSize: Is it needed? (At least theoretically, the return type poses a problem that could be prevented simply by leaving that method out.)

- containsKey, containsValue, get, put, remove: Why the NullPointerException? Why would an implementation choose not to support null references to interfaces as keys and/or values? How would KeySet.has and KeySet.remove handle this?

- get: I would let it return Optional<any> and not raise NoSuchElementException, so that it can be used more naturally in multi-threaded scenarios.

- put: Better let it return Optional<any>. What exactly is meant with "@return [...] <NULL/> if there was no such previous association"?

- remove: An alternative would be to let it return Optional<any> and not raise NoSuchElementException (again, this might be more appropriate in certain multi-threaded scenarios).

- create, createImmutable: You need to clarify what "unsupported types" are.

- create: You need to clarify whether and when put on the resulting XMap will raise IllegalArgumentException.

- createImmutable:  How are invalid elements in _values handled?

-Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to