Breadcrumbs

setMapValue() Operation

Syntax

set anObject = map.setMapValue(aKey, anotherObject)

Semantics

Within map map, replace the object of the map entry identified by akey with anotherObject. The operation returns the old content (being replaced). If the addressed key does not exists, the item is appended to the map.

Substitutables

anObject

optional: The map entry being replaced. 

map

An object of type Map.

type_map.png

aKey

Key value identifying the map entry.

anotherObject

The object to replace the map entry with.

Examples

create oldAddress;
  
create newAddress;
set newAddress.street = "99, Kings Road";
set newAddress.town = "London";
  
set oldAddress = hashMap.setMapValue("John Snow", newAddress);

oldAddress and newAddress are objects of type Address. name is the key of the map:

class_Address.png
📗