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

Last change on this file since 195 was 195, checked in by dai, 16 years ago

オブジェクトの循環参照を許容した(構造体はダメ)。
抽象クラスをメンバの型に指定できるようにした。
メンバがオブジェクトだったとき、自動的にNewするのをやめ、初期値としてNothingを指定するようにした。

【ArrayListの改良】
・ArrayList_Elementを廃止し、実装をArrayListのprivateに置いた。
・一通りのパラメータを*ObjectからObjectへ変更した。

【その他】
・TypeInfo改良中...
・Objectクラスに実行時型情報用のtypeInfoメンバを追加した。

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