IlsMvKeyValueTable
 
IlsMvKeyValueTable
Category 
Dynamic view-related class
Inheritance Path 
IlsMvUserType
IlsMvArray
IlsMvKeyValueTable
Description 
This class associates a key with a value.The key and value are of type IlsMvValue , thus allowing you to use this class in a wide variety of cases. All C++ basic types can be used as keys and values. The classes IlsString, MvArray, and even MvKeyValueTable can also be used. As a user type, this type is also available under the name MvKeyValueTable to be compliant with the JavaTM API naming conventions.
Libraries 
<mvserver> and <mvcomp>
Header File 
#include <ilserver/mvarray.h>
Synopsis 
class IlsMvKeyValueTable: public IlsMvArray {
public:
IlsMvKeyValueTable();
IlsMvKeyValueTable(const MvArray& orig);
IlsMvKeyValueTable(const MvKeyValueTable& orig);
 
const IlsMvValue& getKey(unsigned int index) const;
const IlsMvValue& getValue(unsigned int index) const;
const IlsMvValue& getItemValue(const IlsMvValue& key) const;
int getItemIndex(const IlsMvValue& key) const;
IlsBoolean addItem(const IlsMvValue& key,
const IlsMvValue& value);
IlsBoolean setItemValue(const IlsMvValue& key,
const IlsMvValue& value);
IlsBoolean hasItem(const IlsMvValue& key) const;
IlsBoolean removeItem(const IlsMvValue& key);
static const MvKeyValueTable& Null();
};
Constructors 
IlsMvKeyValueTable();
This default constructor initializes an empty instance of IlsMvKeyValueTable.
IlsMvKeyValueTable(const MvArray& orig);
This constructor initializes the IlsMvKeyValueTable instance with IlsMvArray objects. The orig parameter means that to work properly as a key-value table, the referenced instance of IlsMvArray must contain arrays that are made up of two items (a key and a value).
IlsMvKeyValueTable(const MvKeyValueTable& orig);
This is a copy constructor.
Member Functions 
const IlsMvValue& getKey(unsigned int index) const;
This member function returns the key corresponding to the specified index.
const IlsMvValue& getValue(unsigned int index) const;
This member function returns the value corresponding to the specified index.
const IlsMvValue& getItemValue(const IlsMvValue& key) const;
This member function retrieves the value of the item that corresponds to the specified key.
int getItemIndex(const IlsMvValue& key) const;
This member function retrieves the index of the item that corresponds to the specified key.
IlsBoolean addItem(const IlsMvValue& key, const IlsMvValue& value);
This member function adds a key-value association to the table. It returns IlsFalse if the key is already used in the table.
IlsBoolean setItemValue(const IlsMvValue& key,
const IlsMvValue& value);
This member function sets the specified key to the specified value. It returns IlsTrue if the key is already in the table.
IlsBoolean hasItem(const IlsMvValue& key) const;
This member function returns IlsTrue if there is an association with the key in the table.
IlsBoolean removeItem(const IlsMvValue& key);
This member function removes the association with the key from the table. It returns IlsTrue if the association was in the table.
[static] const MvKeyValueTable& Null(){return _Null;
This static member function returns an empty table.
See Also 
IlsMvValue, IlsString

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.