/MEng/System/Runtime/KVPair

ClassPath:MEng.System.Runtime.KVPair
Parent ClassPath:MEng.Object
Copyable:Yes
Final:Yes

MEng.System.Runtime.KVPair provides support for a very common data structure, which is that of two strings, one of which represents a key and the other a value associated with that key, i.e. a set of named values.

 

Constructors:

Constructor();
Constructor([In] MEng.String Key, [In] MEng.String Value);

The default constructor creates an object with empty key and value fields. The second constructor allows you to set up the key/value fields during construction.

 

Final, Const Methods:

CopyKey([Out] MEng.String ToFill);
CopyValue([Out] MEng.String ToFill);

These method copy out the values of the key or value to your provided string. If you already have a string to fill, these are more efficient than the GetKey()/GetValue() versions below, which return a copy.

Equal([In] MEng.System.Runtime.KVPair ToComp) Returns MEng.Boolean;
operator=
(
    [In]   MEng.System.Runtime.KVPair Src1
    , [In] MEng.System.Runtime.KVPair Src2
) Returns MEng.Boolean;

Compares the two objects and returns True if they are equal and False if they are unequal. Neither object is affected. They do the same thing, are only only syntactically different.

GetKey() Returns MEng.String;
GetValue() Returns MEng.String;

These method return the current values of the two fields. If you want to get a copy of them, use the CopyKey()/CopyValue() versions above, which will copy into your provided string. These are just conveniences for when you want to get the values for one-shot, inline purposes.

MatchesKey([In] MEng.String ToCheck) Returns MEng.Boolean;

Returns a Boolean value that indicate whether the passed string matches the key field of this object. This is more efficient than calling GetKey() can comparing, since it doesn't require a copy of the key value in order to return it.

SameKey([In] MEng.System.Runtime.KVPair ToComp) Returns MEng.Boolean;
SameValue([In] MEng.System.Runtime.KVPair ToComp) Returns MEng.Boolean;

Returns a Boolean value that indicates whether the passed key/value pair has the same key or value as this one. This is more efficient than calling the GetXX() method on each of them and comparing the results, since those require a copy of the members to be made for return.

 

Final, Non-Const Methods:

SetKey([In] MEng.String ToSet);
SetValue([In] MEng.String ToSet);

These methods allow you to individually update the key or value members.

Set([In] MEng.String KeyToSet, [In] MEng.String ValToSet);

This method allows you to update both the key and value members at the same time.