68 <td>Private method to adjust the cache to its size.</td> |
68 <td>Private method to adjust the cache to its size.</td> |
69 </tr><tr> |
69 </tr><tr> |
70 <td><a href="#E5Cache.__moveLast">__moveLast</a></td> |
70 <td><a href="#E5Cache.__moveLast">__moveLast</a></td> |
71 <td>Private method to move a cached item to the MRU position.</td> |
71 <td>Private method to move a cached item to the MRU position.</td> |
72 </tr><tr> |
72 </tr><tr> |
|
73 <td><a href="#E5Cache.__pruneCache">__pruneCache</a></td> |
|
74 <td>Private slot to prune outdated cache entries and restart the timer.</td> |
|
75 </tr><tr> |
73 <td><a href="#E5Cache.add">add</a></td> |
76 <td><a href="#E5Cache.add">add</a></td> |
74 <td>Public method to add an item to the cache.</td> |
77 <td>Public method to add an item to the cache.</td> |
75 </tr><tr> |
78 </tr><tr> |
76 <td><a href="#E5Cache.clear">clear</a></td> |
79 <td><a href="#E5Cache.clear">clear</a></td> |
77 <td>Public method to clear the cache.</td> |
80 <td>Public method to clear the cache.</td> |
78 </tr><tr> |
81 </tr><tr> |
79 <td><a href="#E5Cache.get">get</a></td> |
82 <td><a href="#E5Cache.get">get</a></td> |
80 <td>Public method to get an entry from the cache given its key.</td> |
83 <td>Public method to get an entry from the cache given its key.</td> |
81 </tr><tr> |
84 </tr><tr> |
|
85 <td><a href="#E5Cache.getMaximumCacheTime">getMaximumCacheTime</a></td> |
|
86 <td>Public method to get the maximum time entries may exist in the cache.</td> |
|
87 </tr><tr> |
82 <td><a href="#E5Cache.getSize">getSize</a></td> |
88 <td><a href="#E5Cache.getSize">getSize</a></td> |
83 <td>Public method to get the size of the cache.</td> |
89 <td>Public method to get the maximum size of the cache.</td> |
84 </tr><tr> |
90 </tr><tr> |
85 <td><a href="#E5Cache.info">info</a></td> |
91 <td><a href="#E5Cache.info">info</a></td> |
86 <td>Public method to get some information about the cache.</td> |
92 <td>Public method to get some information about the cache.</td> |
87 </tr><tr> |
93 </tr><tr> |
88 <td><a href="#E5Cache.length">length</a></td> |
94 <td><a href="#E5Cache.length">length</a></td> |
92 <td>Public method to remove an item from the cache.</td> |
98 <td>Public method to remove an item from the cache.</td> |
93 </tr><tr> |
99 </tr><tr> |
94 <td><a href="#E5Cache.reset">reset</a></td> |
100 <td><a href="#E5Cache.reset">reset</a></td> |
95 <td>Public method to reset the cache.</td> |
101 <td>Public method to reset the cache.</td> |
96 </tr><tr> |
102 </tr><tr> |
|
103 <td><a href="#E5Cache.setMaximumCacheTime">setMaximumCacheTime</a></td> |
|
104 <td>Public method to set the maximum time entries may exist in the cache.</td> |
|
105 </tr><tr> |
97 <td><a href="#E5Cache.setSize">setSize</a></td> |
106 <td><a href="#E5Cache.setSize">setSize</a></td> |
98 <td>Public method to change the size of the cache.</td> |
107 <td>Public method to change the maximum size of the cache.</td> |
99 </tr> |
108 </tr> |
100 </table> |
109 </table> |
101 <h3>Static Methods</h3> |
110 <h3>Static Methods</h3> |
102 <table> |
111 <table> |
103 <tr><td>None</td></tr> |
112 <tr><td>None</td></tr> |
125 </p><dl> |
134 </p><dl> |
126 <dt><i>key</i> (any hashable type that can be used as a dict key)</dt> |
135 <dt><i>key</i> (any hashable type that can be used as a dict key)</dt> |
127 <dd> |
136 <dd> |
128 key of the item to be retrieved |
137 key of the item to be retrieved |
129 </dd> |
138 </dd> |
130 </dl><a NAME="E5Cache.add" ID="E5Cache.add"></a> |
139 </dl><a NAME="E5Cache.__pruneCache" ID="E5Cache.__pruneCache"></a> |
|
140 <h4>E5Cache.__pruneCache</h4> |
|
141 <b>__pruneCache</b>(<i></i>) |
|
142 <p> |
|
143 Private slot to prune outdated cache entries and restart the timer. |
|
144 </p><a NAME="E5Cache.add" ID="E5Cache.add"></a> |
131 <h4>E5Cache.add</h4> |
145 <h4>E5Cache.add</h4> |
132 <b>add</b>(<i>key, item</i>) |
146 <b>add</b>(<i>key, item</i>) |
133 <p> |
147 <p> |
134 Public method to add an item to the cache. |
148 Public method to add an item to the cache. |
135 </p><p> |
149 </p><p> |
169 </dl><dl> |
183 </dl><dl> |
170 <dt>Return Type:</dt> |
184 <dt>Return Type:</dt> |
171 <dd> |
185 <dd> |
172 object or None |
186 object or None |
173 </dd> |
187 </dd> |
|
188 </dl><a NAME="E5Cache.getMaximumCacheTime" ID="E5Cache.getMaximumCacheTime"></a> |
|
189 <h4>E5Cache.getMaximumCacheTime</h4> |
|
190 <b>getMaximumCacheTime</b>(<i></i>) |
|
191 <p> |
|
192 Public method to get the maximum time entries may exist in the cache. |
|
193 </p><dl> |
|
194 <dt>Returns:</dt> |
|
195 <dd> |
|
196 maximum cache time in seconds |
|
197 </dd> |
|
198 </dl><dl> |
|
199 <dt>Return Type:</dt> |
|
200 <dd> |
|
201 int |
|
202 </dd> |
174 </dl><a NAME="E5Cache.getSize" ID="E5Cache.getSize"></a> |
203 </dl><a NAME="E5Cache.getSize" ID="E5Cache.getSize"></a> |
175 <h4>E5Cache.getSize</h4> |
204 <h4>E5Cache.getSize</h4> |
176 <b>getSize</b>(<i></i>) |
205 <b>getSize</b>(<i></i>) |
177 <p> |
206 <p> |
178 Public method to get the size of the cache. |
207 Public method to get the maximum size of the cache. |
179 </p><dl> |
208 </p><dl> |
180 <dt>Returns:</dt> |
209 <dt>Returns:</dt> |
181 <dd> |
210 <dd> |
182 maximum number of entries of the cache |
211 maximum number of entries of the cache |
183 </dd> |
212 </dd> |
232 <p> |
261 <p> |
233 Public method to reset the cache. |
262 Public method to reset the cache. |
234 </p><p> |
263 </p><p> |
235 This is like clear() but sets the various counters to their initial |
264 This is like clear() but sets the various counters to their initial |
236 value as well. |
265 value as well. |
237 </p><a NAME="E5Cache.setSize" ID="E5Cache.setSize"></a> |
266 </p><a NAME="E5Cache.setMaximumCacheTime" ID="E5Cache.setMaximumCacheTime"></a> |
|
267 <h4>E5Cache.setMaximumCacheTime</h4> |
|
268 <b>setMaximumCacheTime</b>(<i>time</i>) |
|
269 <p> |
|
270 Public method to set the maximum time entries may exist in the cache. |
|
271 </p><dl> |
|
272 <dt><i>time</i> (int)</dt> |
|
273 <dd> |
|
274 maximum cache time in seconds |
|
275 </dd> |
|
276 </dl><a NAME="E5Cache.setSize" ID="E5Cache.setSize"></a> |
238 <h4>E5Cache.setSize</h4> |
277 <h4>E5Cache.setSize</h4> |
239 <b>setSize</b>(<i>newSize</i>) |
278 <b>setSize</b>(<i>newSize</i>) |
240 <p> |
279 <p> |
241 Public method to change the size of the cache. |
280 Public method to change the maximum size of the cache. |
242 </p><dl> |
281 </p><dl> |
243 <dt><i>newSize</i> (int)</dt> |
282 <dt><i>newSize</i> (int)</dt> |
244 <dd> |
283 <dd> |
245 maximum number of entries that may be stored in the |
284 maximum number of entries that may be stored in the |
246 cache |
285 cache |