pw::Collection

Type for a group of entities

Derives From

pw::Object

Information

In the context of the pw::Collection, an entity refers to objects of or derived from the following types:

Summary
pw::CollectionType for a group of entities
Static Actions
createThis action creates a new collection object.
Instance Actions
deleteThis action deletes the collection.
setThis action sets the members of a collection.
addThis action adds members to a collection.
removeThis action removes members from a collection.
containsThis action specifies if a collection contains a given entity.
listThis action returns a list of entity objects in a collection.
getEntityCountThis action returns the number of entities in a collection.
doThis action performs a command on each entity in the collection.
getResultThis action obtains the results of the last do operation.
resultListThis action returns a list of results in a collection.

Static Actions

create

pw::Collection create

This action creates a new collection object.

Parameters

None

Returns

This action returns a new pw::Collection object.

Instance Actions

delete

$collection delete

This action deletes the collection.

Parameters

None

Returns

This action returns nothing.

set

$collection set entity_list

This action sets the members of a collection.  Any existing membership is cleared.

Parameters

entity_listThis parameter is a list of entity objects to assign to the collection.

Returns

This action returns the pw::Collection object.

add

$collection add entity_list

This action adds members to a collection.  Any existing membership is not changed.

Parameters

entity_listThis parameter is the list of entity objects to add to the collection.

Returns

This action returns the pw::Collection object.

remove

$collection remove entity_list

This action removes members from a collection.

Parameters

entity_listThis parameter is the list of entity objects to remove from the collection.

Returns

This action returns the pw::Collection object.

contains

$collection contains entity

This action specifies if a collection contains a given entity.

Parameters

entityThis parameter is the entity object to check for.

Returns

This action returns a boolean, which is true if the entity is in the collection.

list

$collection list

This action returns a list of entity objects in a collection.

Parameters

None

Returns

This action returns the a list of entity objects.

getEntityCount

$collection getEntityCount

This action returns the number of entities in a collection.

Parameters

None

Returns

This action returns the integer entity count.

do

$collection do ?-strict? action ?args...?

This action performs a command on each entity in the collection.

Parameters

-strictThis optional flag checks the result for each entity, and returns an error for the command if the command failed for any one entity.
actionThis parameter is the name string of the action to be performed by each entity.
args...These parameters are a sequence of zero or more action arguments.

Returns

This action returns a boolean, which is false if one of the commands changed the membership status of one or more entities, indicating that not all entities may have been processed.

See Also

getResult

getResult

$collection getResult entity ?resultVar?

This action obtains the results of the last do operation.

Parameters

entityThis parameter is the entity object of interest.
resultVarThis parameter is the name string of the boolean variable to hold the entity result value.  If the action was successful for this entity, the variable will be set to true.

Returns

This action returns the command-specific result of the action on the given entity.

Information

An error is raised if the entity is not in the collection.

See Also

do

resultList

$collection resultList

This action returns a list of results in a collection.

Parameters

None

Returns

This action returns the result list.  Note: the order of the result list is guaranteed only to be in the same order as the list returned by list, which may not be the same as the order the objects were added to the collection.

See Also

list

pw::Collection create
This action creates a new collection object.
$collection delete
This action deletes the collection.
$collection set entity_list
This action sets the members of a collection.
$collection add entity_list
This action adds members to a collection.
$collection remove entity_list
This action removes members from a collection.
$collection contains entity
This action specifies if a collection contains a given entity.
$collection list
This action returns a list of entity objects in a collection.
$collection getEntityCount
This action returns the number of entities in a collection.
$collection do ?-strict? action ?args...?
This action performs a command on each entity in the collection.
$collection getResult entity ?resultVar?
This action obtains the results of the last do operation.
$collection resultList
This action returns a list of results in a collection.
Base type for all glyph types
Entity type
A node is the zero-dimensional boundary of a one-dimensional pw::Connector.
An edge is part of a domain boundary, consisting of oriented, node-connected pw::Connector objects.
A domain is a computationally two-dimensional grid entity, bounded by one or more pw::Edges.
A face is part of a block boundary, consisting of oriented, edge-connected pw::Domain objects.
Connector and Curve segment type
Base class for distribution types
Base class for spacing types
Type for a group of entities
A boolean is represented as a 0 or 1, with 0 being false and 1 being true.
An integer is a whole number.
A string is an array of characters.
Close