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

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

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

File size: 666 bytes
Line 
1Class Object
2Public
3
4 Sub Object()
5 End Sub
6 Sub ~Object()
7 End Sub
8
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
23 Return VarPtr( This ) As Long
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.