1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XStringKeyMap.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __com_sun_star_container_XStringKeyMap_idl__
32 #define __com_sun_star_container_XStringKeyMap_idl__
34 #ifndef __com_sun_star_uno_XInterface_idl__
35 #include
<com
/sun
/star
/uno
/XInterface.idl
>
38 #ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
39 #include
<com
/sun
/star
/lang
/IndexOutOfBoundsException.idl
>
42 #ifndef __com_sun_star_container_ElementExistException_idl__
43 #include
<com
/sun
/star
/container
/ElementExistException.idl
>
46 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
47 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
50 #ifndef __com_sun_star_container_NoSuchElementException_idl__
51 #include
<com
/sun
/star
/container
/NoSuchElementException.idl
>
54 //=============================================================================
56 module com
{ module sun
{ module star
{ module container
{
58 //=============================================================================
60 /** maps strings to anys.
65 interface XStringKeyMap
67 //-------------------------------------------------------------------------
68 /** reads data from the map.
71 The key string which should be searched for.
74 the value matching aKey.
76 @throws com::sun::star::container::NoSuchElementException
77 if an element under aKey does not exist.
79 any getValue
( [in] string aKey
)
80 raises
( com
::sun
::star
::container
::NoSuchElementException
);
83 //-------------------------------------------------------------------------
84 /** checks for element existence.
87 The key string which should be searched for.
90 true if an element with key aKey exists.
92 boolean hasValue
( [in] string aKey
);
95 //-------------------------------------------------------------------------
96 /** writes data to the map.
99 The key string which should be used to store the value.
102 The value that should be stored.
104 @throws com::sun::star::lang::IllegalArgumentException
105 if the element could not be inserted.
107 @throws com::sun::star::container::ElementExistException
108 if there is already a value stored under the key aKey.
110 void insertValue
( [in] string aKey
, [in] any aValue
)
111 raises
( com
::sun
::star
::lang
::IllegalArgumentException
,
112 com
::sun
::star
::container
::ElementExistException
);
115 //-------------------------------------------------------------------------
116 /** the number of elements in the map.
118 [attribute
, readonly] long Count
;
121 //-------------------------------------------------------------------------
122 /** obtains the key of an element by index.
125 is the index of the element.
128 the key string matching the given index.
130 @throws com::sun::star::lang::IndexOutOfBoundsException
131 if the specified index is greater than the number of
134 string getKeyByIndex
( [in] long nIndex
)
135 raises
( com
::sun
::star
::lang
::IndexOutOfBoundsException
);
138 //-------------------------------------------------------------------------
139 /** obtains the value of an element by index.
142 is the index of the key.
145 the value matching the given index.
147 @throws com::sun::star::lang::IndexOutOfBoundsException
148 if the specified index is greater than the number of
151 any getValueByIndex
( [in] long nIndex
)
152 raises
( com
::sun
::star
::lang
::IndexOutOfBoundsException
);