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_XEnumerableMap_idl__
27 #define __com_sun_star_container_XEnumerableMap_idl__
29 #include
<com
/sun
/star
/container
/XMap.idl
>
30 #include
<com
/sun
/star
/container
/XEnumeration.idl
>
31 #include
<com
/sun
/star
/lang
/NoSupportException.idl
>
33 //=============================================================================
35 module com
{ module sun
{ module star
{ module container
{
37 //=============================================================================
39 /** extends <type>XMap</type> with enumeration capabilities.
41 <p>No assumption should be made about the ordering of the elements returned by the various enumerators.
42 In particular, you cannot assume the elements are returned in the same order as they were inserted. Also,
43 you should not expect the <code>XMap</code> implementation to make use of a possibly existing strict ordering
44 defined on the domain of all possible key values.</p>
46 <p>You can create enumerators for the keys of the map, its values, and its key-value pairs.</p>
48 <p>In all cases, you can create an <em>isolated</em> enumerator, which works on a copy of the
49 map's content. Such an iterator is not affected by changes done to the map after creation of
52 <p>On the contrary, an enumerator which is <em>non-isolated</em> works directly on the map data.
53 This is less expensive than an <em>isolated</em> enumerator, but means that changes to the map while
54 an enumeration is running potentially invalidate your enumerator. The concrete behavior in this
55 case is undefined, it's up to the service implementing the <code>XEnumerableMap</code> interface
56 to specify it in more detail.</p>
58 <p>Implementations of this interface might decide to support only <em>isolated</em> enumerators, or
59 only <em>non-isolated</em> enumerators. Again, it's up to the service to specify this. Requesting an
60 enumerator type which is not supported will generally result in an <type scope="com::sun::star::lang">NoSupportException</type>
63 interface XEnumerableMap
: XMap
65 /** creates a enumerator for the keys of the map
68 controls whether the newly create enumerator should be isolated from the map.
70 @throws ::com::sun::star::lang::NoSupportException
71 if the specified enumerator method is not supported by the implementation.
73 XEnumeration createKeyEnumeration
( [in] boolean Isolated
)
74 raises
( ::com
::sun
::star
::lang
::NoSupportException
);
76 /** creates a enumerator for the values of the map
79 controls whether the newly create enumerator should be isolated from the map.
81 @throws ::com::sun::star::lang::NoSupportException
82 if the specified enumerator method is not supported by the implementation.
84 XEnumeration createValueEnumeration
( [in] boolean Isolated
)
85 raises
( ::com
::sun
::star
::lang
::NoSupportException
);
87 /** creates a enumerator for the key-value pairs of the map
89 <p>The elements returned by the enumerator are instances of <type scope="com::sun::star::beans">Pair</type>,
90 holding the key-value-pairs which are part of the map.</p>
93 controls whether the newly create enumerator should be isolated from the map.
95 @throws ::com::sun::star::lang::NoSupportException
96 if the specified enumerator method is not supported by the implementation.
98 XEnumeration createElementEnumeration
( [in] boolean Isolated
)
99 raises
( ::com
::sun
::star
::lang
::NoSupportException
);
102 //=============================================================================
106 //=============================================================================