Changeset 313 for trunk


Ignore:
Timestamp:
Aug 27, 2007, 12:50:51 AM (17 years ago)
Author:
イグトランス (egtra)
Message:

Itemの戻り値型をTにできた

File:
1 edited

Legend:

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

    r312 r313  
    88
    99Namespace Detail
    10     Class Pair<TKey, T>
     10    Class Pair
    1111    Public
    12         Sub Pair(key As TKey, value As T)
     12        Sub Pair(key As Object, value As Object)
    1313            Key = key
    1414            Value = value
    1515        End Sub
    1616
    17         Key As TKey
    18         Value As T
     17        Key As Object
     18        Value As Object
    1919    End Class
    2020End Namespace 'Detail
     
    5353            Dim i As Long
    5454            For i = 0 To ELM(a.Count)
    55                 Dim pair = a[i] As Pair<T, Key>
     55                Dim pair = a[i] As Pair
    5656                If pair.Key.Equals(key) Then
    5757                    Return pair.Value
     
    8181            Dim i As Long
    8282            For i = 0 To ELM(a.Count)
    83                 Dim pair = a[i] As Pair<T, Key>
     83                Dim pair = a[i] As Pair
    8484                If pair.Key.Equals(key) Then
    8585                    pair.Value = value
     
    8888        End If
    8989
    90         a.Add(New Pair<T, Key>(key, value))
     90        a.Add(New Pair(key, value))
    9191    End Sub
    9292
     
    9595/*
    9696    'Operators
    97     Function Operator [](key As Key) As T
     97'   Function Operator [](key As Key) As T
     98    Function Operator [](key As Key) As Object
    9899        Return Item[key]
    99100    End Function
     
    121122            Dim i As Long
    122123            For i = 0 To ELM(a.Count)
    123                 Dim pair = a[i] As Pair<T, Key>
     124                Dim pair = a[i] As Pair
    124125                If pair.Key.Equals(key) Then
    125126                    'Throw ArgumentError
     
    128129        End If
    129130
    130         a.Add(New Pair<T, Key>(key, value))
     131        a.Add(New Pair(key, value))
    131132    End Sub
    132133
     
    161162        Dim e = al[0]
    162163        Dim p = ObjPtr(e) As ULONG_PTR
    163         OutputDebugString(ToTCStr(Str$(p)))
    164164    End Sub
    165165
Note: See TracChangeset for help on using the changeset viewer.