Package muntjac :: Package data :: Package util :: Module list_set :: Class ListSet
[hide private]
[frames] | no frames]

Class ListSet

source code

object --+    
         |    
      list --+
             |
            ListSet

ListSet is an internal Muntjac class which implements a combination of a List and a Set. The main purpose of this class is to provide a list with a fast contains method. Each inserted object must by unique (as specified by equals). The set method allows duplicates because of the way sort works.

This class is subject to change and should not be used outside Muntjac core.

Instance Methods [hide private]
new empty list
__init__(self, *args)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
contains(self, o) source code
 
__contains__(self, item)
y in x
source code
 
containsAll(self, c) source code
 
append(self, val)
append object to end
source code
 
insert(self, idx, val)
insert object before index
source code
 
add(self, *args)
Works as list.append or list.insert but returns immediately if the element is already in the ListSet.
source code
 
extend(self, iterable)
extend list by appending elements from the iterable
source code
 
addAll(self, *args) source code
 
clear(self) source code
 
index(self, val)
L.index(value, [start, [stop]]) -> integer -- return first index of value.
source code
 
indexOf(self, o) source code
 
lastIndexOf(self, o) source code
 
remove(self, o)
remove first occurrence of value.
source code
 
removeRange(self, fromIndex, toIndex) source code
 
set(self, index, element) source code
 
removeFromSet(self, e)
Removes "e" from the set if it no longer exists in the list.
source code
 
addDuplicate(self, element)
Marks the "element" can be found more than once from the list.
source code
 
clone(self) source code

Inherited from list: __add__, __delitem__, __delslice__, __eq__, __ge__, __getattribute__, __getitem__, __getslice__, __gt__, __iadd__, __imul__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __new__, __repr__, __reversed__, __rmul__, __setitem__, __setslice__, __sizeof__, count, pop, reverse, sort

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

Class Variables [hide private]

Inherited from list: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Returns: new empty list
Overrides: object.__init__
(inherited documentation)

__contains__(self, item)
(In operator)

source code 

y in x

Overrides: list.__contains__
(inherited documentation)

append(self, val)

source code 

append object to end

Overrides: list.append
(inherited documentation)

insert(self, idx, val)

source code 

insert object before index

Overrides: list.insert
(inherited documentation)

extend(self, iterable)

source code 

extend list by appending elements from the iterable

Overrides: list.extend
(inherited documentation)

index(self, val)

source code 

L.index(value, [start, [stop]]) -> integer -- return first index of value. Raises ValueError if the value is not present.

Overrides: list.index
(inherited documentation)

remove(self, o)

source code 

remove first occurrence of value. Raises ValueError if the value is not present.

Overrides: list.remove
(inherited documentation)

addDuplicate(self, element)

source code 

Marks the "element" can be found more than once from the list. Allowed in set to make sorting work.