Changeset 366 for trunk/Include


Ignore:
Timestamp:
Oct 31, 2007, 4:24:47 AM (17 years ago)
Author:
dai
Message:

Dictionary.Countメソッドを実装。
String.Equalsメソッドのコードミスを修正。

Location:
trunk/Include/Classes/System
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Include/Classes/System/Collections/Generic/Dictionary.ab

    r313 r366  
    4444        If Object.ReferenceEquals(key, Nothing) Then
    4545            'Throw ArgumentNullError
    46             Exit Sub
     46            debug
     47            Exit Function
    4748        End If
    4849
     
    5960            Next
    6061        End If
     62        debug
    6163        'KeyNotFoundException
    6264        Return Nothing
     
    130132
    131133        a.Add(New Pair(key, value))
     134
     135        count ++
    132136    End Sub
    133137
     
    138142        Next
    139143    End Sub
     144
     145    Function Count() As Long
     146        Return count
     147    End Function
    140148
    141149'   Function ContainsKey(key As Key) As Boolean
     
    162170        Dim e = al[0]
    163171        Dim p = ObjPtr(e) As ULONG_PTR
     172
     173        count = 0
    164174    End Sub
    165175
    166176    al As ArrayList
     177    count As Long
    167178
    168179End Class
  • trunk/Include/Classes/System/String.ab

    r308 r366  
    251251
    252252        Override Function Equals(s As Object) As Boolean
    253             If This.GetType = s.GetType Then
     253            If Object.Equals( This.GetType(), s.GetType() ) Then
    254254                Return This.Equals(s As String)
    255255            End If
Note: See TracChangeset for help on using the changeset viewer.