Package advene :: Package model :: Package core :: Module element :: Class ElementCollection
[hide private]
[frames] | no frames]

Class ElementCollection

source code

object --+
         |
        ElementCollection
Known Subclasses:

A base-class for coder-friendly and TAL-friendly element collections.

Subclasses must override either __iter__ or both __len__ and __getitem__.

In most cases, it is a good idea to override __contains__, and __len__ (even if the subclass is overriding __iter__).

The class attribute _allow_filtering can also be overridden to disallow the use of the filter method.

Instance Methods [hide private]
 
__init__(self, owner_package)
Initialise the element collection.
source code
 
__eq__(self, other) source code
 
__iter__(self)
Default implementation relying on __len__ and __getitem__.
source code
 
__len__(self)
Default (and inefficient) implementation relying on __iter__.
source code
 
__getitem__(self, key)
Default implementation relying on __iter__.
source code
 
__repr__(self)
repr(x)
source code
 
get(self, key, default=None) source code
 
keys(self) source code
 
filter(collection, **kw)
Use underlying iter method with the given keywords to make a filtered version of that collection.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Class Variables [hide private]
  _allow_filter = True
Properties [hide private]
  _tales_size
Return the size of the group.
  _tales_first
  _tales_rest

Inherited from object: __class__

Method Details [hide private]

__init__(self, owner_package)
(Constructor)

source code 

Initialise the element collection.

`owner_package`is used only in the `get` method, to provide a context to the ID-ref.

Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

Property Details [hide private]

_tales_size

Return the size of the group.

Get Method:
unreachable._tales_size(self) - Return the size of the group.

_tales_first

Get Method:
unreachable._tales_first(self)

_tales_rest

Get Method:
unreachable._tales_rest(self)