source: Include/Classes/System/Collections/misc.ab@ 106

Last change on this file since 106 was 55, checked in by イグトランス (egtra), 18 years ago

DictionaryEntry

File size: 3.0 KB
Line 
1' Classes/System/Collections/misc.ab
2
3#ifndef __SYSTEM_COLLECTIONS_MISC_AB__
4#define __SYSTEM_COLLECTIONS_MISC_AB__
5
6Interface IObject
7End Interface
8
9Interface ICollection
10 Inherits /* IObject, */IEnumerable
11 ' Properties
12 Const Function Count() As Long
13 Const Function IsSynchronized() As BOOL
14 ' Function SyncRoot() As ...
15 ' Methods
16 ' Sub CopyTo(ByRef array As ..., index As Long)
17End Interface
18
19Interface IComparer
20 Inherits IObject
21 ' Methods
22 Function Compare(ByRef x As IObject, ByRef y As IObject) As Long
23End Interface
24
25Interface IDictionary
26 Inherits /*IObject, */ ICollection /*, IEnumerable */
27 ' Methods
28 Sub Add(ByRef key As IObject, ByRef value As IObject)
29 Sub Clear()
30 Const Function Contains(ByRef key As IObject) As BOOL
31 Const Function GetEnumerator() As *IDictionaryEnumerator
32 Const Function Remove(ByRef key As IObject) As BOOL
33 ' Properties
34 Const Function IsFixedSize() As BOOL
35 Const Function IsReadOnly() As BOOL
36 Const Function Operator [](ByRef key As IObject) As *IObject
37 Sub Operator []=(ByRef key As IObject, ByRef value As IObject)
38 Const Function Keys() As *ICollection
39 Const Function Values() As ICollection
40End Interface
41
42Interface IDictionaryEnumerator
43 Inherits IEnumerator
44 ' Properties
45 Const Function Entry() As DictionaryEntry
46 Const Function Key() As *IObject
47 Const Function Value() As *IObject
48End Interface
49
50Interface IEnumerable
51 Inherits IObject
52 ' Method
53 Function GetEnumerator() As *IEnumerator
54End Interface
55
56Interface IEnumerator
57 Inherits IObject
58 ' Methods
59 Function MoveNext() As BOOL
60 Sub Reset()
61 ' Property
62 Function Current() As *IObject
63End Interface
64
65Interface IEqualityComparer
66 Inherits IObject
67 ' Methods
68 Function Equals(ByRef x As Object, ByRef y As Object) As BOOL
69 Function GetHashCode(ByRef obj As IObject) As Long
70End Interface
71
72Interface IList
73 Inherits ICollection /*, IEnumerable */
74 ' Methods
75 Function Add(ByRef value As IObject) As Long
76 Sub Clear()
77 Const Function Contains(ByRef value As IObject) As BOOL
78 Const Function IndexOf(ByRef value As IObject) As Long
79 Sub Insert(index As Long, ByRef value As IObject)
80 Sub Remove(ByRef value As IObject)
81 Sub RemoveAt(index As Long)
82 ' Properties
83 Const Function IsFixedSize() As BOOL
84 Const Function IsReadOnly() As BOOL
85 Const Function Operator [](index As Long) As *IObject
86 Const Sub Operator []=(index As Long, ByRef obj As IObject)
87End Interface
88
89Class DictionaryEntry
90 Inherits IObject
91Public
92 ' Constructors
93 Sub DictionaryEntry()
94 k = 0
95 v = 0
96 End Sub
97
98 Sub DictionaryEntry(ByRef key As IObject, ByRef value As IObject)
99 k = VarPtr(key)
100 v = VarPtr(value)
101 End Sub
102
103 ' Properties
104 Const Function Key() As *IObject
105 Return k
106 End Function
107
108 Sub Key(ByRef key As IObject)
109 k = VarPtr(key)
110 End Sub
111
112 Const Function Value() As *IObject
113 Return v
114 End Function
115
116 Sub Value(ByRef value As IObject)
117 v = VarPtr(value)
118 End Sub
119Private
120 k As *IObject
121 v As *IObject
122End Class
123
124#endif '__SYSTEM_COLLECTIONS_MISC_AB__
Note: See TracBrowser for help on using the repository browser.