Package jazzparser :: Package data :: Class HashSet
[hide private]
[frames] | no frames]

Class HashSet

source code

object --+
         |
        HashSet
Known Subclasses:

A simple implementation of a hash table using a dictionary. The table is a set, since it does not store duplicate entries.

Stores pointers both in a hash table (dictionary) and a list, so that the values can be retreived quickly.

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
_add_existing_value(self, existing_value, new_value)
When a value already exists in the table, this is called instead of adding the value.
source code
 
append(self, new_entry)
Appends the new entry to the set if it's not already there.
source code
 
extend(self, entries)
Appends each of the given entries to the set.
source code
 
__contains__(self, value) source code
 
values(self) source code
 
remove(self, entry) source code
 
__len__(self) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

_add_existing_value(self, existing_value, new_value)

source code 

When a value already exists in the table, this is called instead of adding the value. By default, it does nothing (i.e. drops the new value), but you can override it if you want to do something else to combine the values.

Note that your custom methods must only modify the sign that's already in the set (existing_value), not add a new sign and not modify new_value.

append(self, new_entry)

source code 

Appends the new entry to the set if it's not already there. Returns true if the entry is added, false otherwise.

extend(self, entries)

source code 

Appends each of the given entries to the set. Returns true if any of them is added, false otherwise.