VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "KidClubIterator"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
'Klasa KidClubIterator
Implements Iterator
Private index As Integer
Private kidList As Collection
Private club As String
'-----
Public Sub init(col As Collection, clb As String)
  index = 1
  Set kidList = col
  club = clb
End Sub
'-----
Private Function Iterator_hasMoreElements() As Boolean
  Dim more As Boolean
  Dim kd As Kid
  more = index <= kidList.Count
  If more Then
    Set kd = kidList(index)
    While more And kd.getClub <> club
      Set kd = kidList(index)
      index = index + 1
      more = index <= kidList.Count
    Wend
  End If
  Iterator_hasMoreElements = more
End Function
'-----
Private Sub Iterator_moveFirst()
  index = 1
End Sub
'-----
Private Function Iterator_nextElement() As Object
  Set Iterator_nextElement = kidList(index)
  index = index + 1
End Function
