1*408a4873SAndrew Rist/************************************************************** 2cdf0e10cSrcweir * 3*408a4873SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*408a4873SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*408a4873SAndrew Rist * distributed with this work for additional information 6*408a4873SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*408a4873SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*408a4873SAndrew Rist * "License"); you may not use this file except in compliance 9*408a4873SAndrew Rist * with the License. You may obtain a copy of the License at 10*408a4873SAndrew Rist * 11*408a4873SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*408a4873SAndrew Rist * 13*408a4873SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*408a4873SAndrew Rist * software distributed under the License is distributed on an 15*408a4873SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*408a4873SAndrew Rist * KIND, either express or implied. See the License for the 17*408a4873SAndrew Rist * specific language governing permissions and limitations 18*408a4873SAndrew Rist * under the License. 19*408a4873SAndrew Rist * 20*408a4873SAndrew Rist *************************************************************/ 21*408a4873SAndrew Rist 22*408a4873SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir#ifndef __com_sun_star_container_XEnumerableMap_idl__ 25cdf0e10cSrcweir#define __com_sun_star_container_XEnumerableMap_idl__ 26cdf0e10cSrcweir 27cdf0e10cSrcweir#include <com/sun/star/container/XMap.idl> 28cdf0e10cSrcweir#include <com/sun/star/container/XEnumeration.idl> 29cdf0e10cSrcweir#include <com/sun/star/lang/NoSupportException.idl> 30cdf0e10cSrcweir 31cdf0e10cSrcweir//============================================================================= 32cdf0e10cSrcweir 33cdf0e10cSrcweirmodule com { module sun { module star { module container { 34cdf0e10cSrcweir 35cdf0e10cSrcweir//============================================================================= 36cdf0e10cSrcweir 37cdf0e10cSrcweir/** extends <type>XMap</type> with enumeration capabilities. 38cdf0e10cSrcweir 39cdf0e10cSrcweir <p>No assumption should be made about the ordering of the elements returned by the various enumerators. 40cdf0e10cSrcweir In particular, you cannot assume the elements are returned in the same order as they were inserted. Also, 41cdf0e10cSrcweir you should not expect the <code>XMap</code> implementation to make use of a possibly existing strict ordering 42cdf0e10cSrcweir defined on the domain of all possible key values.</p> 43cdf0e10cSrcweir 44cdf0e10cSrcweir <p>You can create enumerators for the keys of the map, its values, and its key-value pairs.</p> 45cdf0e10cSrcweir 46cdf0e10cSrcweir <p>In all cases, you can create an <em>isolated</em> enumerator, which works on a copy of the 47cdf0e10cSrcweir map's content. Such an iterator is not affected by changes done to the map after creation of 48cdf0e10cSrcweir the enumerator.</p> 49cdf0e10cSrcweir 50cdf0e10cSrcweir <p>On the contrary, an enumerator which is <em>non-isolated</em> works directly on the map data. 51cdf0e10cSrcweir This is less expensive than an <em>isolated</em> enumerator, but means that changes to the map while 52cdf0e10cSrcweir an enumeration is running potentially invalidate your enumerator. The concrete behavior in this 53cdf0e10cSrcweir case is undefined, it's up to the service implementing the <code>XEnumerableMap</code> interface 54cdf0e10cSrcweir to specify it in more detail.</p> 55cdf0e10cSrcweir 56cdf0e10cSrcweir <p>Implementations of this interface might decide to support only <em>isolated</em> enumerators, or 57cdf0e10cSrcweir only <em>non-isolated</em> enumerators. Again, it's up to the service to specify this. Requesting an 58cdf0e10cSrcweir enumerator type which is not supported will generally result in an <type scope="com::sun::star::lang">NoSupportException</type> 59cdf0e10cSrcweir being thrown.</p> 60cdf0e10cSrcweir */ 61cdf0e10cSrcweirinterface XEnumerableMap : XMap 62cdf0e10cSrcweir{ 63cdf0e10cSrcweir /** creates a enumerator for the keys of the map 64cdf0e10cSrcweir 65cdf0e10cSrcweir @param Isolated 66cdf0e10cSrcweir controls whether the newly create enumerator should be isolated from the map. 67cdf0e10cSrcweir 68cdf0e10cSrcweir @throws ::com::sun::star::lang::NoSupportException 69cdf0e10cSrcweir if the specified enumerator method is not supported by the implementation. 70cdf0e10cSrcweir */ 71cdf0e10cSrcweir XEnumeration createKeyEnumeration( [in] boolean Isolated ) 72cdf0e10cSrcweir raises ( ::com::sun::star::lang::NoSupportException ); 73cdf0e10cSrcweir 74cdf0e10cSrcweir /** creates a enumerator for the values of the map 75cdf0e10cSrcweir 76cdf0e10cSrcweir @param Isolated 77cdf0e10cSrcweir controls whether the newly create enumerator should be isolated from the map. 78cdf0e10cSrcweir 79cdf0e10cSrcweir @throws ::com::sun::star::lang::NoSupportException 80cdf0e10cSrcweir if the specified enumerator method is not supported by the implementation. 81cdf0e10cSrcweir */ 82cdf0e10cSrcweir XEnumeration createValueEnumeration( [in] boolean Isolated ) 83cdf0e10cSrcweir raises ( ::com::sun::star::lang::NoSupportException ); 84cdf0e10cSrcweir 85cdf0e10cSrcweir /** creates a enumerator for the key-value pairs of the map 86cdf0e10cSrcweir 87cdf0e10cSrcweir <p>The elements returned by the enumerator are instances of <type scope="com::sun::star::beans">Pair</type>, 88cdf0e10cSrcweir holding the key-value-pairs which are part of the map.</p> 89cdf0e10cSrcweir 90cdf0e10cSrcweir @param Isolated 91cdf0e10cSrcweir controls whether the newly create enumerator should be isolated from the map. 92cdf0e10cSrcweir 93cdf0e10cSrcweir @throws ::com::sun::star::lang::NoSupportException 94cdf0e10cSrcweir if the specified enumerator method is not supported by the implementation. 95cdf0e10cSrcweir */ 96cdf0e10cSrcweir XEnumeration createElementEnumeration( [in] boolean Isolated ) 97cdf0e10cSrcweir raises ( ::com::sun::star::lang::NoSupportException ); 98cdf0e10cSrcweir}; 99cdf0e10cSrcweir 100cdf0e10cSrcweir//============================================================================= 101cdf0e10cSrcweir 102cdf0e10cSrcweir}; }; }; }; 103cdf0e10cSrcweir 104cdf0e10cSrcweir//============================================================================= 105cdf0e10cSrcweir 106cdf0e10cSrcweir#endif 107