Example: Current® property (JavaMethodCollection class)

This script prints out the position within the collection where there is a toString method.

Dim mySession As JavaSession
Dim myClass As JavaClass
Dim myMethod As JavaMethod
Dim myMCollection As JavaMethodCollection
	
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()

Set myMethod = myMCollection.getFirst()
Do
	If myMethod.MethodName = "toString" then
		Print "toString" & myMethod.Signature & _
      " is located at the " & myMCollection.Current & _
      " element within the collection"
	End If
	Set myMethod = myMCollection.getNext()

Loop While myMCollection.Current <> 1
' Because getNext loops back to 1 when the end is reached