Package elisa :: Package core :: Package observers :: Module list :: Class ListObservable
[hide private]
[frames] | no frames]

Class ListObservable

source code


ListObservable implements an observable list. It has all the functionalities of a normal list and in addition informs all its observers about any change to its content.

Its notification protocol is defined in ListObserver. It is advised to use a subclass of ListObserver in order to observe an instance of ListObservable. All the methods that do writing operations declare what message they send to the observers in their documentation.

Notification messages are always sent to the observers after the actual operation is done.

Instance Methods [hide private]
 
__init__(self, *args, **kw)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_send_message_to_observers(self, message, *args) source code
 
__hash__(self)
hash(x)
source code
 
__repr__(self)
repr(x)
source code
 
__eq__(self, other) source code
 
__setitem__(self, key, value)
Send the message 'modified' to the observers.
source code
 
__delitem__(self, key)
Send the message 'removed' to the observers.
source code
 
append(self, element)
Send the message 'inserted' to the observers.
source code
 
extend(self, elements)
Send the message 'inserted' to the observers.
source code
 
insert(self, position, element)
Send the message 'inserted' to the observers.
source code
 
pop(self, position=-1)
Send the message 'removed' to the observers.
source code
 
remove(self, element)
Send the message 'removed' to the observers.
source code
 
reverse(self)
Send the message 'dirtied' to the observers.
source code
 
sort(self, *args, **kwargs)
Send the message 'dirtied' to the observers.
source code
 
__iadd__(self, operand)
Send the message 'inserted' to the observers.
source code
 
__imul__(self, coefficient)
Send the message 'inserted' to the observers.
source code
 
__setslice__(self, i, j, elements)
Send successively the message 'removed' and the message 'inserted' to the observers.
source code
 
__delslice__(self, i, j)
Send the message 'removed' to the observers.
source code
 
add_observer(self, observer)
Attach an observer which will then be notified of all the changes applied to the observable.
source code
 
remove_observer(self, observer)
Detach an observer which will not be notified anymore of changes applied to the observable.
source code
 
attribute_set(self, origin, key, old_value, new_value) source code

Inherited from extern.log.log.Loggable: debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure

Inherited from utils.threadsafe_list.ThreadsafeList: __add__, __contains__, __copy__, __deepcopy__, __getitem__, __getslice__, __iter__, __len__, __mul__, count, index

Inherited from list: __ge__, __getattribute__, __gt__, __le__, __lt__, __ne__, __new__, __reversed__, __rmul__

Inherited from object: __delattr__, __reduce__, __reduce_ex__, __setattr__, __str__

Class Variables [hide private]

Inherited from extern.log.log.Loggable: logCategory

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args, **kw)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: log.Loggable.__init__

__hash__(self)
(Hashing function)

source code 
hash(x)
Overrides: list.__hash__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 
repr(x)
Overrides: list.__repr__
(inherited documentation)

__eq__(self, other)
(Equality operator)

source code 
Overrides: utils.threadsafe_list.ThreadsafeList.__eq__

__setitem__(self, key, value)
(Index assignment operator)

source code 
Send the message 'modified' to the observers.
Overrides: utils.threadsafe_list.ThreadsafeList.__setitem__

__delitem__(self, key)
(Index deletion operator)

source code 
Send the message 'removed' to the observers.
Overrides: utils.threadsafe_list.ThreadsafeList.__delitem__

append(self, element)

source code 
Send the message 'inserted' to the observers.
Overrides: utils.threadsafe_list.ThreadsafeList.append

extend(self, elements)

source code 
Send the message 'inserted' to the observers.
Overrides: utils.threadsafe_list.ThreadsafeList.extend

insert(self, position, element)

source code 
Send the message 'inserted' to the observers.
Overrides: utils.threadsafe_list.ThreadsafeList.insert

pop(self, position=-1)

source code 
Send the message 'removed' to the observers.
Overrides: utils.threadsafe_list.ThreadsafeList.pop

remove(self, element)

source code 
Send the message 'removed' to the observers.
Overrides: utils.threadsafe_list.ThreadsafeList.remove

reverse(self)

source code 
Send the message 'dirtied' to the observers.
Overrides: utils.threadsafe_list.ThreadsafeList.reverse

sort(self, *args, **kwargs)

source code 
Send the message 'dirtied' to the observers.
Overrides: utils.threadsafe_list.ThreadsafeList.sort

__iadd__(self, operand)

source code 
Send the message 'inserted' to the observers.
Overrides: utils.threadsafe_list.ThreadsafeList.__iadd__

__imul__(self, coefficient)

source code 
Send the message 'inserted' to the observers.
Overrides: utils.threadsafe_list.ThreadsafeList.__imul__

__setslice__(self, i, j, elements)
(Slice assignment operator)

source code 
Send successively the message 'removed' and the message 'inserted' to the observers.
Overrides: utils.threadsafe_list.ThreadsafeList.__setslice__

__delslice__(self, i, j)
(Slice deletion operator)

source code 
Send the message 'removed' to the observers.
Overrides: utils.threadsafe_list.ThreadsafeList.__delslice__

add_observer(self, observer)

source code 
Attach an observer which will then be notified of all the changes applied to the observable.
Parameters:

remove_observer(self, observer)

source code 
Detach an observer which will not be notified anymore of changes applied to the observable.
Parameters: