ecl-logo Documentation

ObjectP

ObjectP[]pattern

returns a pattern which matches an object, model, link, or packet of any defined type.

ObjectP[type]pattern

returns a pattern which matches an object, model, link, or packet that is a sub-type of type.

ObjectP[type, fields]pattern

returns a pattern which matches an object, model, or link that is a sub-type of 'type, or a packet that is a sub-type of type and includes the keys in fields.

ObjectP[Object]pattern

returns a pattern which matches an object, link containing an object, or packet of an object of any defined Object types.

ObjectP[Model]pattern

returns a pattern which matches a model, link containing a model, or packet of a model of any defined Model types.

ObjectP[reference]pattern

returns a pattern which matches an object, link containing an object, or packet of a model for the specific reference.

ObjectP[link]pattern

returns a pattern which matches an object, link containing an object, or packet of a model for the specific link.

Details

    Input
    Output

Examples

Basic Examples  (5)

Returns a pattern which matches an object/model/link/packet of any defined type:

Returns a pattern that matches an Object of any sub-types of the defined Model type:

Returns a pattern that matches any Object of any sub-types of the list of defined types:

Returns a pattern that does not match a type that is not defined:

An empty association is not a packet because it is missing the Type key:

Additional Examples  (18)

Returns a pattern that matches a Model of any Model sub-types:

Returns a pattern that does not match an Object of any Object sub-types:

Returns a pattern that matches an Object of any Object sub-types:

Returns a pattern that does not match a Model of any Model sub-types:

Returns a pattern that matches an Object with no type information:

Returns a pattern that matches a Model with no type information:

Matches a Link without a link-id:

Matches a Link containing object of specific type:

Matches only links to objects of a given type:

Returns a pattern which matches an packet of any defined type:

Returns a pattern that matches an Object of any sub-types of the defined Model type:

Returns a pattern that does not match an Object of any Object sub-types:

Returns a pattern that matches an Object of any Object sub-types:

Returns a pattern that matches a packet with a specific Object Reference:

Returns a pattern that does not match a packet with a different Object Reference:

Returns a pattern that matches a link of with a specific Object Reference:

Returns a pattern that matches a specific Object Reference:

Required fields can be provided for packets: