Water 5-User Interface-HTML Layout
method get_with_value
Contract
Return typewob
Parameter keyDefault valueType
a_keyreq
a_valuereq
returns"first"string
Water Contract
<method get_with_value
  a_key  =req
  a_value=req
  returns="first"/>
get_with_value finds objects within _subject that have a field of the given key whose value is the given value. get_with_value walks the fields of _subject in a depth-first order.

a wob
Parameter keyDefault valueType
returns"first"string

a wob
returns="first"
"first" (the default) then the first object which has the key with the proper value will be returned. If no such object is found, null is returned.
a wob
returns="last"
The last object which has the key with the proper value will be returned. If no such object is found, null is returned.
a wob
returns="all"
A vector of all the objects which have the key with the proper value will be returned.

Note that the _subject itself is the first object checked and if it matches, it will be included in the result.
<thing deep=<thing weight=135/>/>.<get_with_value "weight" 135/>
<thing weight=135/>
<vector <thing material="cloth"/>
             <thing weight=135 material="cotton"/>
             <thing deep=<thing deeper=<vector 31
                                          <thing weight=135 material="silver"/>
                                          <thing weight=135 material="gold"/> />/>/>/>.
       <get_with_value "weight" 135 returns="all"/>
<vector <thing material="cotton" weight=135/> <thing material="silver" weight=135/> <thing material="gold" weight=135/>/>