-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcList.py
41 lines (33 loc) · 906 Bytes
/
cList.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import queue;
class cList(object):
def __init__(oSelf, axValue = []):
oSelf.oValueQueue = queue.Queue();
oSelf.oValueQueue.put(axValue);
@property
def uSize(oSelf):
axValue = oSelf.oValueQueue.get();
try:
return len(axValue);
finally:
oSelf.oValueQueue.put(axValue);
@property
def axValue(oSelf):
axValue = oSelf.oValueQueue.get();
try:
return axValue[:];
finally:
oSelf.oValueQueue.put(axValue);
def fAdd(oSelf, xValue):
axValue = oSelf.oValueQueue.get();
axValue.append(xValue);
oSelf.oValueQueue.put(axValue);
def fRemove(oSelf, xValue):
axValue = oSelf.oValueQueue.get();
axValue.remove(xValue);
oSelf.oValueQueue.put(axValue);
def fbContains(oSelf, xValue):
axValue = oSelf.oValueQueue.get();
try:
return xValue in axValue;
finally:
oSelf.oValueQueue.put(axValue);