LibreOffice LibreOffice 25.8 SDK API Reference

Public Member Functions | Public Attributes | List of all members
XStringKeyMap Interface Reference

maps strings to anys. More...

`import"XStringKeyMap.idl";`

## Public Member Functions
any | getValue ([in] string aKey) raises ( com::sun::star::container::NoSuchElementException )
| reads data from the map. More...
boolean | hasValue ([in] string aKey)
| checks for element existence. More...
void | insertValue ([in] string aKey, [in] any aValue) raises ( com::sun::star::lang::IllegalArgumentException, com::sun::star::container::ElementExistException )
| writes data to the map. More...
string | getKeyByIndex ([in] long nIndex) raises ( com::sun::star::lang::IndexOutOfBoundsException )
| obtains the key of an element by index. More...
any | getValueByIndex ([in] long nIndex) raises ( com::sun::star::lang::IndexOutOfBoundsException )
| obtains the value of an element by index. More...

## Public Attributes
long | Count
| the number of elements in the map. More...

## Detailed Description

maps strings to anys.

Since
  OOo 2.3

## Member Function Documentation

## ◆ getKeyByIndex()

string getKeyByIndex | ( | [in] long | nIndex | ) |
raises | ( | com::sun::star::lang::IndexOutOfBoundsException
| ) |  |

obtains the key of an element by index.

Parameters

  nIndex | is the index of the element.

Returns
  the key string matching the given index.

Exceptions

  com::sun::star::lang::IndexOutOfBoundsException | if the specified index is greater than the number of elements

## ◆ getValue()

any getValue | ( | [in] string | aKey | ) |
raises | ( | com::sun::star::container::NoSuchElementException
| ) |  |

reads data from the map.

Parameters

  aKey | The key string which should be searched for.

Returns
  the value matching aKey.

Exceptions

  com::sun::star::container::NoSuchElementException | if an element under aKey does not exist.

## ◆ getValueByIndex()

any getValueByIndex | ( | [in] long | nIndex | ) |
raises | ( | com::sun::star::lang::IndexOutOfBoundsException
| ) |  |

obtains the value of an element by index.

Parameters

  nIndex | is the index of the key.

Returns
  the value matching the given index.

Exceptions

  com::sun::star::lang::IndexOutOfBoundsException | if the specified index is greater than the number of elements

## ◆ hasValue()

boolean hasValue | ( | [in] string | aKey | ) |

checks for element existence.

Parameters

  aKey | The key string which should be searched for.

Returns
  true if an element with key aKey exists.

## ◆ insertValue()

void insertValue | ( | [in] string | aKey,
|  | [in] any | aValue
| ) |  |
raises | ( | com::sun::star::lang::IllegalArgumentException,
|  | com::sun::star::container::ElementExistException
| ) |  |

writes data to the map.

Parameters

  aKey | The key string which should be used to store the value.
  aValue | The value that should be stored.

Exceptions

  com::sun::star::lang::IllegalArgumentException | if the element could not be inserted.
  com::sun::star::container::ElementExistException | if there is already a value stored under the key aKey.

## Member Data Documentation

## ◆ Count

long Count
| attribute readonly

the number of elements in the map.

The documentation for this interface was generated from the following file:

- com/sun/star/container/XStringKeyMap.idl