source: Include/Classes/System/Object.ab@ 164

Last change on this file since 164 was 70, checked in by dai, 18 years ago

デフォルトのGetHashCodeメソッドを実装。

File size: 666 bytes
RevLine 
[51]1Class Object
2Public
3
[58]4 Sub Object()
5 End Sub
6 Sub ~Object()
7 End Sub
8
[51]9 ' 2つのオブジェクトが等しいかどうかを判断する
10 Virtual Function Equals( ByRef obj As Object ) As Boolean
11 If VarPtr( This ) = VarPtr( obj ) Then
12 Return True
13 Else
14 Return False
15 End If
16 End Function
17 Static Function Equals( ByRef objA As Object, ByRef objB As Object ) As Boolean
18 Return objA.Equals( objB )
19 End Function
20
21 ' ハッシュコードを取得する
22 Virtual Function GetHashCode() As Long
[70]23 Return VarPtr( This ) As Long
[51]24 End Function
25
26 ' オブジェクトに関係する文字列を返す
27 Virtual Function ToString() As String
28 Return "Object"
29 End Function
30End Class
Note: See TracBrowser for help on using the repository browser.