Changeset 542 for trunk/ab5.0/ablib/src/Classes/System
- Timestamp:
- Jul 13, 2008, 2:29:17 AM (16 years ago)
- Location:
- trunk/ab5.0/ablib/src/Classes/System
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/ablib/src/Classes/System/Collections/Generic/Dictionary.ab
r537 r542 47 47 Dim a = al[hash] As ArrayList 48 48 49 If Not Object.ReferenceEquals(a, Nothing) Then49 If Not ActiveBasic.IsNothing(a) Then 50 50 Dim i As Long 51 51 For i = 0 To ELM(a.Count) … … 77 77 If pair.Key.Equals(key) Then 78 78 pair.Value = value 79 Exit Sub 79 80 End If 80 81 Next … … 135 136 End Function 136 137 137 ' Function ContainsKey(key As Key) As Boolean 138 ' End Function 138 /*! 139 @biref 指定されたキーが格納されているか調べる。 140 @date 2008/07/11 141 @param[in] key 検索対象のキー 142 @retval True 格納されていたとき 143 @retval False 格納されていなかったとき 144 @throw ArgumentNullException keyがNothingだったとき 145 @author Egtra 146 */ 147 Function ContainsKey(key As Key) As Boolean 148 If ActiveBasic.IsNothing(key) Then 149 Throw New ArgumentNullException("key") 150 End If 151 ContainsKey = False 152 153 Dim hash = getHash(key) 154 Dim a = al[hash] As ArrayList 155 156 If Not ActiveBasic.IsNothing(a) Then 157 Dim i As Long 158 For i = 0 To ELM(a.Count) 159 Dim pair = a[i] As Detail.Pair 160 If pair.Key.Equals(key) Then 161 ContainsKey = True 162 Exit Function 163 End If 164 Next 165 End If 166 End Function 167 139 168 ' Function ContainsValue(value As T) As Boolean 140 169 ' End Function … … 169 198 End Function 170 199 171 ' Function TryGetValue(key As Key, ByRef value As T) As Boolean 172 ' End Function 200 Function TryGetValue(key As Key, ByRef value As T) As Boolean 201 If ActiveBasic.IsNothing(key) Then 202 Throw New ArgumentNullException("key") 203 End If 204 TryGetValue = False 205 value = Nothing 206 207 Dim hash = getHash(key) 208 Dim a = al[hash] As ArrayList 209 210 If Not ActiveBasic.IsNothing(a) Then 211 Dim i As Long 212 For i = 0 To ELM(a.Count) 213 Dim pair = a[i] As Detail.Pair 214 If pair.Key.Equals(key) Then 215 TryGetValue = True 216 value = pair.Value 217 Exit Function 218 End If 219 Next 220 End If 221 End Function 173 222 174 223 'Classses -
trunk/ab5.0/ablib/src/Classes/System/Delegate.ab
r352 r542 29 29 30 30 Sub _Add( dg As DelegateBase ) 31 Dim i As Long 32 For i=0 To ELM(dg.simpleDelegates.Count) 33 simpleDelegates.Add( dg.simpleDelegates[i] ) 34 Next 31 If Not ActiveBasic.IsNothing(dg) Then 32 Dim i As Long 33 For i=0 To ELM(dg.simpleDelegates.Count) 34 simpleDelegates.Add( dg.simpleDelegates[i] ) 35 Next 36 End If 35 37 End Sub 36 38 37 39 Sub _Delete( dg As DelegateBase ) 38 Dim i As Long 39 For i=0 To ELM(This.simpleDelegates.Count) 40 Dim i2 As Long 41 Dim isExist = False 42 For i2=0 To ELM(dg.simpleDelegates.Count) 43 If This.simpleDelegates[i].IsEqual( dg.simpleDelegates[i2] ) Then 44 isExist = True 40 If Not ActiveBasic.IsNothing(dg) Then 41 Dim i As Long 42 For i=0 To ELM(This.simpleDelegates.Count) 43 Dim i2 As Long 44 Dim isExist = False 45 For i2=0 To ELM(dg.simpleDelegates.Count) 46 If This.simpleDelegates[i].IsEqual( dg.simpleDelegates[i2] ) Then 47 isExist = True 48 End If 49 Next 50 If isExist Then 51 This.simpleDelegates.RemoveAt( i ) 45 52 End If 46 53 Next 47 If isExist Then 48 This.simpleDelegates.RemoveAt( i ) 49 End If 50 Next 54 End If 51 55 End Sub 52 56
Note:
See TracChangeset
for help on using the changeset viewer.