Dim mySession As JavaSession
Dim myClass As JavaClass
Dim myMethod As JavaMethod
Dim myMCollection As JavaMethodCollection
Dim Count As Integer, i As Integer
Set mySession = new JavaSession()
' Get Java "java.lang.Integer" class
Set myClass = mySession.GetClass("java/lang/Integer")
' Get a list of all methods belonging
' to the java.lang.Integer class
Set myMCollection = myClass.getClassMethods()
For i = 1 to myMCollection.Count
Set myMethod = myMCollection.getNth(i)
If myMethod.MethodName = "toString" then
Count = Count + 1
End If
Next
Print "There are " & Count & " instances of toString" + _
"method in the Method collection for java.lang.Integer"
Sub Initialize
Dim mySession As JavaSession
Dim myClass As JavaClass
Dim myMCollection As JavaMethodCollection
Dim i As Integer
Dim msg As String
Set mySession = New JavaSession()
Set myClass = mySession.GetClass("java/lang/Object")
Set myMCollection = myClass.GetClassMethods()
i = 1
msg = ""
ForAll m In myMCollection
msg = msg & i & " " & m.MethodName & " " & m.Signature & {
}
i = i + 1
End ForAll
MessageBox msg & "Count is " & myMCollection.Count
End Sub