Package twisted :: Package python :: Module roots :: Class Collection

[frames | no frames]

## Class Collection

Known Subclasses:
  `Constrained`

I represent a static collection of entities.

I contain methods designed to represent collections that can be dynamically created.

Method Summary
| ``__init__`(self, entities)` Initialize me.
| ``delEntity`(self, name)` Remove a static reference for 'name'.
| ``getDynamicEntity`(self, name, request)` Subclass this to generate an entity on demand.
| ``getEntity`(self, name, request)` Retrieve an entity from me.
| ``getStaticEntity`(self, name)` Get an entity that was added to me using putEntity.
| ``listDynamicEntities`(self, request)` A list of all name, entity that I can generate on demand.
| ``listDynamicNames`(self)` Retrieve a list of the names of entities that I store references to.
| ``listEntities`(self, request)` Retrieve a list of all name, entity pairs I contain.
| ``listNames`(self, request)` Retrieve a list of all names for entities that I contain.
| ``listStaticEntities`(self)` Retrieve a list of all name, entity pairs that I store references to.
| ``listStaticNames`(self)` Retrieve a list of the names of entities that I store references to.
| ``putEntity`(self, name, entity)` Store a static reference on 'name' for 'entity'.
| ``removeEntity`(self, name, request)` Remove an entity for 'name', based on the content of 'request'.
| ``storeEntity`(self, name, request)` Store an entity for 'name', based on the content of 'request'.

Method Details

### __init__(self, entities=None)
(Constructor)

Initialize me.

### delEntity(self, name)

Remove a static reference for 'name'.

Raises a KeyError if the operation fails.

### getDynamicEntity(self, name, request)

Subclass this to generate an entity on demand.

This method should return 'None' if it fails.

### getEntity(self, name, request)

Retrieve an entity from me.

I will first attempt to retrieve an entity statically; static entities will obscure dynamic ones. If that fails, I will retrieve the entity dynamically.

If I cannot retrieve an entity, I will return 'None'.

### getStaticEntity(self, name)

Get an entity that was added to me using putEntity.

This method will return 'None' if it fails.

### listDynamicEntities(self, request)

A list of all name, entity that I can generate on demand.

See getDynamicEntity.

### listDynamicNames(self)

Retrieve a list of the names of entities that I store references to.

See getDynamicEntity.

### listEntities(self, request)

Retrieve a list of all name, entity pairs I contain.

See getEntity.

### listNames(self, request)

Retrieve a list of all names for entities that I contain.

See getEntity.

### listStaticEntities(self)

Retrieve a list of all name, entity pairs that I store references to.

See getStaticEntity.

### listStaticNames(self)

Retrieve a list of the names of entities that I store references to.

See getStaticEntity.

### putEntity(self, name, entity)

Store a static reference on 'name' for 'entity'.

Raises a KeyError if the operation fails.

### removeEntity(self, name, request)

Remove an entity for 'name', based on the content of 'request'.

### storeEntity(self, name, request)

Store an entity for 'name', based on the content of 'request'.

Generated by Epydoc 2.0 on Sat May 15 20:08:26 2004 | http://epydoc.sf.net