Package docutils :: Module statemachine :: Class ViewList
[show private | hide private]
[frames | no frames]

Class ViewList

Known Subclasses:
StringList

List with extended functionality: slices of ViewList objects are child lists, linked to their parents. Changes made to a child list also affect the parent list. A child list is effectively a "view" (in the SQL sense) of the parent list. Changes to parent lists, however, do not affect active child lists. If a parent list is changed, any active child lists should be recreated.

The start and end of the slice can be trimmed using the trim_start() and trim_end() methods, without affecting the parent list. The link between child and parent lists can be broken by calling disconnect() on the child list.

Also, ViewList objects keep track of the source & offset of each item. This information is accessible via the source(), offset(), and info() methods.


Method Summary
  __init__(self, initlist, source, items, parent, parent_offset)
  __add__(self, other)
  __cmp__(self, other)
  __contains__(self, item)
  __delitem__(self, i)
  __eq__(self, other)
  __ge__(self, other)
  __getitem__(self, i)
  __gt__(self, other)
  __iadd__(self, other)
  __imul__(self, n)
  __le__(self, other)
  __len__(self)
  __lt__(self, other)
  __mul__(self, n)
  __ne__(self, other)
  __radd__(self, other)
  __repr__(self)
  __rmul__(self, n)
  __setitem__(self, i, item)
  __str__(self)
  append(self, item, source, offset)
  count(self, item)
  disconnect(self)
Break link between this list and parent list.
  extend(self, other)
  index(self, item)
  info(self, i)
Return source & offset for index i.
  insert(self, i, item, source, offset)
  offset(self, i)
Return offset for index i.
  pop(self, i)
  remove(self, item)
  reverse(self)
  sort(self, *args)
  source(self, i)
Return source for index i.
  trim_end(self, n)
Remove items from the end of the list, without touching the parent.
  trim_start(self, n)
Remove items from the start of the list, without touching the parent.

Method Details

disconnect(self)

Break link between this list and parent list.

info(self, i)

Return source & offset for index i.

offset(self, i)

Return offset for index i.

source(self, i)

Return source for index i.

trim_end(self, n=1)

Remove items from the end of the list, without touching the parent.

trim_start(self, n=1)

Remove items from the start of the list, without touching the parent.

Generated by Epydoc 2.0 on Tue Jul 22 05:30:24 2003 http://epydoc.sf.net