1 /*************************************************************************
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * Copyright 2009 by Sun Microsystems, Inc.
6 * OpenOffice.org - a multi-platform office productivity suite
8 * This file is part of OpenOffice.org.
10 * OpenOffice.org is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License version 3
12 * only, as published by the Free Software Foundation.
14 * OpenOffice.org is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License version 3 for more details
18 * (a copy is included in the LICENSE file that accompanied this code).
20 * You should have received a copy of the GNU Lesser General Public License
21 * version 3 along with OpenOffice.org. If not, see
22 * <http://www.openoffice.org/license.html>
23 * for a copy of the LGPLv3 License.
24 ************************************************************************/
26 #ifndef __com_sun_star_container_Map_idl__
27 #define __com_sun_star_container_Map_idl__
29 #include
<com
/sun
/star
/beans
/IllegalTypeException.idl
>
30 #include
<com
/sun
/star
/beans
/Pair.idl
>
31 #include
<com
/sun
/star
/container
/XEnumerableMap.idl
>
33 //=============================================================================
35 module com
{ module sun
{ module star
{ module container
{
37 //=============================================================================
39 /** provides a default <type>XEnumerableMap</type> implementation
41 <p>For the keys put into the map using <member>XMap::put</member> or <member>createImmutable</member>,
42 the following rules apply:
43 <a name="keyrules"></a>
44 <ul><li>A <VOID/> key is not allowed.</li>
45 <li>If the key type is <code>BOOLEAN</code>, <code>CHAR</code>, <code>FLOAT</code>, <code>DOUBLE</code>,
46 <code>STRING</code>, <code>TYPE</code>, or <code>UNSIGNED HYPER</code>, then only keys of exactly this
47 type are accepted.</li>
48 <li>If the key type is <code>DOUBLE</code> or <code>FLOAT</code>, then <code>Double.NaN</code> respectively
49 <code>Float.NaN</code> is not accepted as key.</li>
50 <li>If the key type's class is <member scope="com::sun::star::uno">TypeClass::ENUM</member>, then only keys
51 of exactly this type are accepted.</li>
52 <li>If the key type is any of <code>BYTE</code>, <code>SHORT</code>, <code>UNSIGNED SHORT</code>,
53 <code>LONG</code>, <code>UNSIGNED LONG</code>, or <code>HYPER</code>, then all keys which can losslessly
54 be converted to this type (possibly using widening conversions) are accepted.</li>
55 <li>If the key type is an interface type, then all key values denoting objects which can be queried for
56 the given interface are accepted.</li>
57 <li>All other key types are rejected.</li>
60 <p>For the values put into the map using <member>XMap::put</member> or <member>createImmutable</member>,
61 the following rules apply:
62 <a name="valuerules"></a>
63 <ul><li>The <VOID/> value will be accepted to be put into the map.</p>
64 <li>If the value type's class is <member scope="com::sun::star::uno">TypeClass::ANY</member>, any value
65 will be accepted.</li>
66 <li>If the value type is an interface type, then all values denoting objects which can be queried for
67 the given interface are accepted.</li>
68 <li>If the value type's class is <member scope="com::sun::star::uno">TypeClass::EXCEPTION</member>
69 or <member scope="com::sun::star::uno">TypeClass::STRUCT</member>, then values whose type equals the
70 value type, or is a sub class of the value type, are accepted.</li>
71 <li>For all other value types, only values whose type matches exactly are accepted.</li>
72 <li>If the value type is <code>DOUBLE</code> or <code>FLOAT</code>, then <code>Double.NaN</code> respectively
73 <code>Float.NaN</code> is not accepted.</li>
76 <p>The factory methods of the <code>XEnumerableMap</code> interface support both <em>isolated</em>
77 and <em>non-isolated</em> enumerators. The latter one will be automatically disposed when the map changes
78 after enumerator creation, so every attempt to use them will result in a
79 <type scope="com::sun::star::lang">DisposedException</type> being thrown.</p>
81 @see http://udk.openoffice.org/common/man/typesystem.html
83 service EnumerableMap
: XEnumerableMap
85 /** creates an instance mapping from the given key type to the given value type
88 denotes the type of the keys in the to-be-created map
90 denotes the type of the values in the to-be-created map
92 @throws ::com::sun::star::beans::IllegalTypeException
93 if <arg>KeyType</arg> or <arg>ValueType</arg> are unsupported types.
94 For values, all type classes except <member scope="com::sun::star::uno">TypeClass::VOID</member>
95 and <member scope="com::sun::star::uno">TypeClass::UNKNOWN</member> are accepted.
96 For keys, scalar types, strings, <type scope="com::sun::star::uno">Type</type> itself, and interface
99 create
( [in] type KeyType
, [in] type ValueType
)
100 raises
( ::com
::sun
::star
::beans
::IllegalTypeException
);
102 /** creates an instance mapping from the given key type to the given value type
104 <p>The resulting map is immutable, so later alter operations on it will fail
105 with a <type scope="com::sun::star::lang">NoSupportException</type>.</p>
108 denotes the type of the keys in the to-be-created map
110 denotes the type of the values in the to-be-created map
112 denote the values contained in the to-be-created map
114 @throws ::com::sun::star::beans::IllegalTypeException
115 if <arg>KeyType</arg> or <arg>ValueType</arg> are unsupported types.
116 For values, all type classes except <member scope="com::sun::star::uno">TypeClass::VOID</member>
118 For keys, scalar types, strings, <type scope="com::sun::star::uno">Type</type> itself, and interface
120 @throws ::com::sun::star::lang::IllegalArgumentException
121 if any of the given values or keys violates the <a href="#keyrules">key rules</a> or
122 <a href="#valuerules">value rules</a>.
127 [in] sequence
< ::com
::sun
::star
::beans
::Pair
< any
, any
> > Values
129 raises
( ::com
::sun
::star
::beans
::IllegalTypeException
,
130 ::com
::sun
::star
::lang
::IllegalArgumentException
);
133 //=============================================================================
137 //=============================================================================