A collection that has constraints on its names and/or entities.
Methods
|
|
entityConstraint
nameConstraint
putEntity
reallyPutEntity
|
|
entityConstraint
|
entityConstraint ( self, entity )
A method that determines whether an entity may be added to me.
If the constraint is satisfied, return 1; if the constraint is not
satisfied, either return 0 or raise a descriptive ConstraintViolation.
|
|
nameConstraint
|
nameConstraint ( self, name )
A method that determines whether an entity may be added to me with a given name.
If the constraint is satisfied, return 1; if the constraint is not
satisfied, either return 0 or raise a descriptive ConstraintViolation.
|
|
putEntity
|
putEntity (
self,
name,
entity,
)
Store an entity if it meets both constraints.
Otherwise raise a ConstraintViolation.
Exceptions
|
|
ConstraintViolation( "Entity constraint violated." )
ConstraintViolation( "Name constraint violated." )
|
|
|
reallyPutEntity
|
reallyPutEntity (
self,
name,
entity,
)
|
|