Changeset 118


Ignore:
Timestamp:
Feb 23, 2007, 10:48:08 PM (17 years ago)
Author:
イグトランス (egtra)
Message:

とりあえずおおよそ実装した(未テスト)

Location:
Include/Classes/System/Collections
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • Include/Classes/System/Collections/misc.ab

    r55 r118  
    44#define __SYSTEM_COLLECTIONS_MISC_AB__
    55
    6 Interface IObject
    7 End Interface
    8 
    96Interface ICollection
    10     Inherits /* IObject, */IEnumerable
     7    Inherits IEnumerable
    118    ' Properties
    12     Const Function Count() As Long
    13     Const Function IsSynchronized() As BOOL
     9    '/*Const*/ Function Count() As Long
     10    '/*Const*/ Function IsSynchronized() As Boolean
    1411    ' Function SyncRoot() As ...
    1512    ' Methods
     
    1815
    1916Interface IComparer
    20     Inherits IObject
    2117    ' Methods
    22     Function Compare(ByRef x As IObject, ByRef y As IObject) As Long
     18    Function Compare(ByRef x As Object, ByRef y As Object) As Long
    2319End Interface
    2420
    2521Interface IDictionary
    26     Inherits /*IObject, */ ICollection /*, IEnumerable */
     22    Inherits ICollection /*, IEnumerable */
    2723    ' Methods
    28     Sub Add(ByRef key As IObject, ByRef value As IObject)
     24    Sub Add(ByRef key As Object, ByRef value As Object)
    2925    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
     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
    3329    ' 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
     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
    4036End Interface
    4137
     
    4339    Inherits IEnumerator
    4440    ' Properties
    45     Const Function Entry() As DictionaryEntry
    46     Const Function Key() As *IObject
    47     Const Function Value() As *IObject
     41    /*Const*/ Function Entry() As DictionaryEntry
     42    /*Const*/ Function Key() As *Object
     43    /*Const*/ Function Value() As *Object
    4844End Interface
    4945
    5046Interface IEnumerable
    51     Inherits IObject
    5247    ' Method
    53     Function GetEnumerator() As *IEnumerator
     48'   Function GetEnumerator() As *IEnumerator
    5449End Interface
    5550
    5651Interface IEnumerator
    57     Inherits IObject
    5852    ' Methods
    59     Function MoveNext() As BOOL
     53    Function MoveNext() As Boolean
    6054    Sub Reset()
    6155    ' Property
    62     Function Current() As *IObject
     56    Function Current() As *Object
    6357End Interface
    6458
    6559Interface IEqualityComparer
    66     Inherits IObject
    6760    ' Methods
    68     Function Equals(ByRef x As Object, ByRef y As Object) As BOOL
    69     Function GetHashCode(ByRef obj As IObject) As Long
     61    Function Equals(ByRef x As Object, ByRef y As Object) As Boolean
     62    Function GetHashCode(ByRef obj As Object) As Long
    7063End Interface
    7164
     
    7366    Inherits ICollection /*, IEnumerable */
    7467    ' 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)
     68    'Function Add(value As *Object) As Long
     69    'Sub Clear()
     70    '/*Const*/ Function Contains(value As *Object) As Boolean
     71    /*Const*/ Function IndexOf(value As *Object) As Long
     72    Sub Insert(index As Long, value As *Object)
     73    Sub Remove(value As *Object)
    8174    Sub RemoveAt(index As Long)
    8275    ' 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)
     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)
    8780End Interface
    8881
    8982Class DictionaryEntry
    90     Inherits IObject
    9183Public
    92     ' Constructors
     84    ' /*Const*/ructors
    9385    Sub DictionaryEntry()
    9486        k = 0
     
    9688    End Sub
    9789
    98     Sub DictionaryEntry(ByRef key As IObject, ByRef value As IObject)
     90    Sub DictionaryEntry(ByRef key As Object, ByRef value As Object)
    9991        k = VarPtr(key)
    10092        v = VarPtr(value)
     
    10294
    10395    ' Properties
    104     Const Function Key() As *IObject
     96    /*Const*/ Function Key() As *Object
    10597        Return k
    10698    End Function
    10799
    108     Sub Key(ByRef key As IObject)
     100    Sub Key(ByRef key As Object)
    109101        k = VarPtr(key)
    110102    End Sub
    111103
    112     Const Function Value() As *IObject
     104    /*Const*/ Function Value() As *Object
    113105        Return v
    114106    End Function
    115107
    116     Sub Value(ByRef value As IObject)
     108    Sub Value(ByRef value As Object)
    117109        v = VarPtr(value)
    118110    End Sub
    119111Private
    120     k As *IObject
    121     v As *IObject
     112    k As *Object
     113    v As *Object
    122114End Class
    123115
Note: See TracChangeset for help on using the changeset viewer.