Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


:: com :: sun :: star :: container ::

unpublished interface XMap
Base Interfaces
XMapXElementAccess

XElementAccess
(referenced interface's summary:)
This is the base interface of all collection interfaces.
Usage Restrictions
not published
Description
describes a map between keys and values.

Keys in the map are unique, and each key maps to exactly one value.

Locating elements in the map, both values and keys, requires a notion of equality of two objects. In conformance with the UNO type system, two values are said to be equal if and only if they have the same type, and both denote the same element of this type's value set.

See also
Map
for a default implementation of this interface

Methods' Summary
clear clears the map, removing all key-value pairs from it.  
containsKey determines whether a mapping for he given key exists in the map  
containsValue determines whether the map contains a mapping to a given value.  
get gets the value to which a given key maps.  
put associates a given key with a given value  
remove removes a key-value mapping, given by key, from the map.  
Attributes' Summary
KeyType denotes the type of the keys in the map.  
ValueType denotes the type of the values in the map.  
Methods' Details
clear
void
clear()
raises( ::com::sun::star::lang::NoSupportException );

Description
clears the map, removing all key-value pairs from it.
Throws
::com::sun::star::beans::NoSupportException if the map is not mutable.
containsKey
boolean
containsKey( [in] any  Key )
raises( ::com::sun::star::beans::IllegalTypeException,
::com::sun::star::lang::IllegalArgumentException );

Description
determines whether a mapping for he given key exists in the map
Parameter Key
is the key whose presence in the map is to be tested.
Returns
true if and only if the map contains a mapping for the given key.
Throws
::com::sun::star::beans::IllegalTypeException if the given key is not of a type which is accepted by the map
Throws
::com::sun::star::lang::IllegalArgumentException if the given key is not supported to be put into the map. It's up to the service implementing the XMap interface to specify which special values are not supported. For instances, implementations might decide to not allow void keys, or to reject Double.NaN (not a number) to due its problematic behavior with respect to equality.
containsValue
boolean
containsValue( [in] any  Value )
raises( ::com::sun::star::beans::IllegalTypeException,
::com::sun::star::lang::IllegalArgumentException );

Description
determines whether the map contains a mapping to a given value.
Parameter Value
is the value whose presence in the map is to be tested.
Returns
true if and only one or more keys map to the given value.
Throws
::com::sun::star::beans::IllegalTypeException if the given value is not of a type which is accepted by the map. It's up to the service implementing the XMap interface to specify which special values are not supported. For instances, implementations might decide to not allow Double.NaN (not a number) to due its problematic behavior with respect to equality.
Throws
::com::sun::star::lang::IllegalArgumentException if the given value is not supported to be put into the map.
get
any
get( [in] any  Key )
raises( ::com::sun::star::beans::IllegalTypeException,
::com::sun::star::lang::IllegalArgumentException,
NoSuchElementException );

Description
gets the value to which a given key maps.
Parameter Key
they key whose associated value is to be returned.
Returns
the value which is associated with the given key.
Throws
::com::sun::star::beans::IllegalTypeException if the given key is not of a type which is accepted by the map
Throws
::com::sun::star::beans::IllegalArgumentException if the given key is not supported to be put into the map. It's up to the service implementing the XMap interface to specify which special values are not supported. For instances, implementations might decide to not allow void keys, or to reject Double.NaN (not a number) to due its problematic behavior with respect to equality.
Throws
::com::sun::star::container::NoSuchElementException if there is no value associated with the given key
put
any
put( [in] any  Key,
[in] any  Value )
raises( ::com::sun::star::lang::NoSupportException,
::com::sun::star::beans::IllegalTypeException,
::com::sun::star::lang::IllegalArgumentException );

Description
associates a given key with a given value

If the map already contains a mapping for the given key, then the old value is replaced by the given new value.

Parameter Key
is the key which the given value should be associated with
Parameter Value
is the value which should be associated with the given key
Returns
the value which was previously associated with the given key, or void if there was no such previous association.
Throws
::com::sun::star::beans::IllegalTypeException if the given key is not of a type which is accepted by the map
Throws
::com::sun::star::lang::IllegalArgumentException if the given key, or the given value, is not supported to be put into the map. It's up to the service implementing the XMap interface to specify which special values are not supported.
For instances, implementations might decide to not allow void keys or values, or to reject Double.NaN (not a number) to due its problematic behavior with respect to equality.
Throws
::com::sun::star::beans::NoSupportException if the map does not support putting new mappings into it
remove
any
remove( [in] any  Key )
raises( ::com::sun::star::lang::NoSupportException,
::com::sun::star::beans::IllegalTypeException,
::com::sun::star::lang::IllegalArgumentException,
NoSuchElementException );

Description
removes a key-value mapping, given by key, from the map.
Parameter Key
is the key whose mapping should be removed from the map
Returns
the value which was associated with the given key before the removal
Throws
::com::sun::star::beans::IllegalTypeException if the given key is not of a type which is accepted by the map
Throws
::com::sun::star::lang::IllegalArgumentException if the given key is not supported to be put into the map. It's up to the service implementing the XMap interface to specify which special values are not supported. For instances, implementations might decide to not allow void keys, or to reject Double.NaN (not a number) to due its problematic behavior with respect to equality.
Throws
::com::sun::star::beans::NoSupportException if the map does not support removing mappings
Throws
::com::sun::star::container::NoSuchElementException if there is no value associated with the given key
Attributes' Details
KeyType
[ readonly ] type KeyType;
Description
denotes the type of the keys in the map.

Implementations are free to accept any supertype of KeyType as keys.

ValueType
[ readonly ] type ValueType;
Description
denotes the type of the values in the map.

Implementations are free to accept any supertype of the ValueType as values.

Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.