Full Name: | herschel.ia.pal.MapContext |
Type: | Java Class -
![]() |
Import: | from herschel.ia.pal import MapContext |
Category |
Groups products (or other Contexts that in turn group products) in a map-like structure.
Products grouped in a MapContext can be subsequently retrieved by key, through the 'refs' method. Note: users may be confused as to why there is a need to have to go though a 'refs' method to add or access products from a MapContext. This is due to a technical limitation in the design which will be addressed in due course.
Example 1: Adding a product to a MapContext | ||
---|---|---|
|
Example 2: Getting a product from a MapContext | ||
---|---|---|
|
Example 3: Saving a MapContext to ProductStorage (same way as any other product) | ||
---|---|---|
|
Method | |
---|---|
Map
getRefs
|
|
get the 'map' of ProductRefs stored. From this 'map', you can put |
Map
getRefs
|
|||
---|---|---|---|
get the 'map' of ProductRefs stored. From this 'map', you can put products into the MapContext, or retrieve products by key. |
|||
Return | |||
Map
A map of product refs. |
|||
Examples | |||
Putting a product into the the MapContext | |||
|
|||
Getting the product from the MapContext with key "john" | |||
|