1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
22 """
23 Provide a basic iterator that allows the user to cycle through
24 the elements in a particular map.
25
26 A cursor should never be directly instantiated. Instead, in should be
27 created by the database class.
28
29 A cursor should only be used for a single pass through the
30 database. If multiple passes are needed, multiple cursors
31 should be used.
32 """
33
35 """
36 Return the first (index, data) pair in the database.
37
38 This should be called before the first call to next(). Note that the
39 data return is in the format of the serialized format stored in the
40 database, not in the more usable class object. The data should be
41 converted to a class using the class's unserialize method.
42
43 If no data is available, None is returned.
44 """
45 return None
46
48 """
49 Return the next (index, data) pair in the database.
50
51 Like the first() method, the data return is in the format of the
52 serialized format stored in the database, not in the more usable class
53 object. The data should be converted to a class using the class's
54 unserialize method.
55
56 None is returned when no more data is available.
57 """
58 return None
59
61 """
62 Close the cursor.
63
64 This should be called when the user is finished using the cursor,
65 freeing up the cursor's resources.
66 """
67 raise NotImplementedError
68
70 """
71 Return the number of records in the table referenced by the cursor.
72 """
73 raise NotImplementedError
74