merged tag ooo/OOO330_m14
[LibreOffice.git] / udkapi / com / sun / star / container / XEnumerableMap.idl
blob6e9b60d4736150a60b71f0dc837b195f9284f59d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ***********************************************************************/
28 #ifndef __com_sun_star_container_XEnumerableMap_idl__
29 #define __com_sun_star_container_XEnumerableMap_idl__
31 #include <com/sun/star/container/XMap.idl>
32 #include <com/sun/star/container/XEnumeration.idl>
33 #include <com/sun/star/lang/NoSupportException.idl>
35 //=============================================================================
37 module com { module sun { module star { module container {
39 //=============================================================================
41 /** extends <type>XMap</type> with enumeration capabilities.
43 <p>No assumption should be made about the ordering of the elements returned by the various enumerators.
44 In particular, you cannot assume the elements are returned in the same order as they were inserted. Also,
45 you should not expect the <code>XMap</code> implementation to make use of a possibly existing strict ordering
46 defined on the domain of all possible key values.</p>
48 <p>You can create enumerators for the keys of the map, its values, and its key-value pairs.</p>
50 <p>In all cases, you can create an <em>isolated</em> enumerator, which works on a copy of the
51 map's content. Such an iterator is not affected by changes done to the map after creation of
52 the enumerator.</p>
54 <p>On the contrary, an enumerator which is <em>non-isolated</em> works directly on the map data.
55 This is less expensive than an <em>isolated</em> enumerator, but means that changes to the map while
56 an enumeration is running potentially invalidate your enumerator. The concrete behavior in this
57 case is undefined, it's up to the service implementing the <code>XEnumerableMap</code> interface
58 to specify it in more detail.</p>
60 <p>Implementations of this interface might decide to support only <em>isolated</em> enumerators, or
61 only <em>non-isolated</em> enumerators. Again, it's up to the service to specify this. Requesting an
62 enumerator type which is not supported will generally result in an <type scope="com::sun::star::lang">NoSupportException</type>
63 being thrown.</p>
65 interface XEnumerableMap : XMap
67 /** creates a enumerator for the keys of the map
69 @param Isolated
70 controls whether the newly create enumerator should be isolated from the map.
72 @throws ::com::sun::star::lang::NoSupportException
73 if the specified enumerator method is not supported by the implementation.
75 XEnumeration createKeyEnumeration( [in] boolean Isolated )
76 raises ( ::com::sun::star::lang::NoSupportException );
78 /** creates a enumerator for the values of the map
80 @param Isolated
81 controls whether the newly create enumerator should be isolated from the map.
83 @throws ::com::sun::star::lang::NoSupportException
84 if the specified enumerator method is not supported by the implementation.
86 XEnumeration createValueEnumeration( [in] boolean Isolated )
87 raises ( ::com::sun::star::lang::NoSupportException );
89 /** creates a enumerator for the key-value pairs of the map
91 <p>The elements returned by the enumerator are instances of <type scope="com::sun::star::beans">Pair</type>,
92 holding the key-value-pairs which are part of the map.</p>
94 @param Isolated
95 controls whether the newly create enumerator should be isolated from the map.
97 @throws ::com::sun::star::lang::NoSupportException
98 if the specified enumerator method is not supported by the implementation.
100 XEnumeration createElementEnumeration( [in] boolean Isolated )
101 raises ( ::com::sun::star::lang::NoSupportException );
104 //=============================================================================
106 }; }; }; };
108 //=============================================================================
110 #endif