class set_kind¶
Enumeration class: the kind of a set.
set_kind Members¶
| Constructors | none |
| Static Method | from_integer() |
| Methods | __cmp__(), __eq__(), __ge__(), __gt__(), __hash__(), __le__(), __lt__(), __ne__(), __repr__(), __str__(), as_integer(), name() |
| Attributes | BIT_VECTOR, FAST_VECTOR, LIST, TREE, TRIE |
set_kind Details¶
-
class
cs.set_kind¶ Enumeration class: the kind of a set.
-
static
from_integer(_inner)¶ Construct an instance from an integer representation.
Parameters: _inner (int) – The integer representation, as returned by set_kind.as_integer().Return type: set_kindRaises: result.ERROR_INVALID_ARGUMENTif_inneris not a valid integer representation for aset_kindinstance.Invariant: For
set_kindx, set_kind.from_integer(x.as_integer()) == x>>> sk = set_kind.LIST.as_integer() >>> sk 1 >>> set_kind.from_integer(sk) <cs.set_kind list>
-
__cmp__(other)¶ Comparison function for
set_kind, with respect to a stable overall ordering.Parameters: other ( set_kind) – Theset_kindobject to compare against.Return type: int Returns: An integer N such that: - N==0 if the two objects compare equal
- N<0 if
self< other - N>0 if
self> other
>>> set_kind.TREE.__cmp__(set_kind.TRIE) -1
-
__eq__(b)¶ Equality operator for
set_kind.Parameters: b ( set_kind) – Theset_kindobject to compare against.Return type: bool Returns: Trueifselfandbcompare equal,Falseotherwise.>>> set_kind.BIT_VECTOR == set_kind.FAST_VECTOR False
-
__ge__(b)¶ Greater-than-or-equal operator for
set_kind.Parameters: b ( set_kind) – Theset_kindobject to compare against.Return type: bool Returns: Trueifself>=b,Falseotherwise.>>> set_kind.TREE >= set_kind.LIST True
-
__gt__(b)¶ Greater-than operator for
set_kind.Parameters: b ( set_kind) – Theset_kindobject to compare against.Return type: bool Returns: Trueifself>b,Falseotherwise.>>> set_kind.FAST_VECTOR > set_kind.BIT_VECTOR False
-
__le__(b)¶ Less-than-or-equal operator for
set_kind.Parameters: b ( set_kind) – Theset_kindobject to compare against.Return type: bool Returns: Trueifself<=b,Falseotherwise.>>> set_kind.TREE <= set_kind.TRIE True
-
__lt__(b)¶ Less-than operator for
set_kind.Parameters: b ( set_kind) – Theset_kindobject to compare against.Return type: bool Returns: Trueifself<b,Falseotherwise.>>> set_kind.LIST < set_kind.FAST_VECTOR False
-
__ne__(b)¶ Inequality operator for
set_kind.Parameters: b ( set_kind) – Theset_kindobject to compare against.Return type: bool Returns: Falseifselfandbcompare equal,Trueotherwise.>>> set_kind.TRIE != set_kind.BIT_VECTOR True
-
__repr__()¶ Get a representation of a
set_kindobject that includes information useful for debugging.Return type: str Returns: The string representation. >>> repr(set_kind.TREE) '<cs.set_kind tree>'
-
__str__()¶ Get a simple string representation of a
set_kindobject.Return type: str Returns: The string representation. >>> str(set_kind.LIST) 'list'
-
as_integer()¶ Get an integer representation of
self.Return type: int Returns: An integer suitable for use with set_kind.from_integer().Invariant: For
set_kindx, set_kind.from_integer(x.as_integer()) == x>>> sk = set_kind.LIST.as_integer() >>> sk 1 >>> set_kind.from_integer(sk) <cs.set_kind list>
-
name()¶ Get the name of a
set_kindobject.Return type: str Returns: The name. >>> set_kind.FAST_VECTOR.name() 'fast-vector'
-
BIT_VECTOR¶ bit vector
>>> set_kind.BIT_VECTOR <cs.set_kind bit-vector>
-
FAST_VECTOR¶ fast vector
>>> set_kind.FAST_VECTOR <cs.set_kind fast-vector>
-
LIST¶ list
>>> set_kind.LIST <cs.set_kind list>
-
TREE¶ tree
>>> set_kind.TREE <cs.set_kind tree>
-
TRIE¶ [CodeSurfer only] trie
>>> set_kind.TRIE <cs.set_kind trie>
-
static