Package Bio :: Package Pathway :: Package Rep :: Module HashSet :: Class HashSet
[show private | hide private]
[frames | no frames]

Class HashSet


A set abstraction supporting the basic set operations.

This implementation requires that all elements are hashable, which implies that elements must not mutate while contained.
Method Summary
  __init__(self, elements)
Initializes a new HashSet.
  __contains__(self, element)
Returns true iff this set contains element.
  __eq__(self, set)
Returns true iff x == y for all elements in self, set.
  __len__(self)
Returns the number of elements in this set.
  __ne__(self, set)
Returns true iff this set is not equal to set.
  __repr__(self)
Returns a debugging string representation of this set.
  __str__(self)
Returns a string representation of this set.
  add(self, element)
Adds element to this set.
  cartesian(self, s)
Returns the Cartesian product of this set and s.
  contains(self, element)
Returns true iff this set contains element.
  difference(self, s)
Returns the difference of this set and s.
  empty(self)
Returns true iff this set is empty.
  intersection(self, s)
Returns the intersection of this set and s.
  list(self)
Returns the elements of this set in a list.
  remove(self, element)
Removes element from this set.
  union(self, s)
Returns the union of this set and s.

Method Details

__init__(self, elements=[])
(Constructor)

Initializes a new HashSet.

__contains__(self, element)
(In operator)

Returns true iff this set contains element.

__eq__(self, set)
(Equality operator)

Returns true iff x == y for all elements in self, set.

__len__(self)
(Length operator)

Returns the number of elements in this set.

__ne__(self, set)

Returns true iff this set is not equal to set.

__repr__(self)
(Representation operator)

Returns a debugging string representation of this set.

__str__(self)
(Informal representation operator)

Returns a string representation of this set.

add(self, element)

Adds element to this set.

cartesian(self, s)

Returns the Cartesian product of this set and s.

contains(self, element)

Returns true iff this set contains element.

difference(self, s)

Returns the difference of this set and s.

empty(self)

Returns true iff this set is empty.

intersection(self, s)

Returns the intersection of this set and s.

list(self)

Returns the elements of this set in a list.

remove(self, element)

Removes element from this set.

union(self, s)

Returns the union of this set and s.

Generated by Epydoc 2.1 on Mon Aug 27 16:43:47 2007 http://epydoc.sf.net