VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "DB_Rules"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

Private data_ As Excel.Worksheet

Public Function Init(target As Excel.Worksheet)
  Set data_ = target
End Function

Public Function IBegin() As IteratorRule
  Set IBegin = New IteratorRule
  Call IBegin.Init(data_)
End Function

Public Function ILast() As IteratorRule
  Set ILast = New IteratorRule
  Call ILast.Init(data_)
  Call ILast.GoLast
End Function

Public Function INew() As IteratorRule
  Set INew = New IteratorRule
  Call INew.Init(data_)
  Call INew.GoLast
  Call INew.Increment
End Function

Public Function Count() As Long
  Count = ILast.row_ - IBegin.row_ + 1
End Function

Public Function FindRule(sID$) As IteratorRule
  Dim iRule As IteratorRule: Set iRule = IBegin
  If iRule.GoToID(sID) Then _
    Set FindRule = iRule
End Function

Public Function ClearStats()
  Dim iRule As IteratorRule: Set iRule = IBegin
  Do Until iRule.IsDone
    iRule.ErrorsCount = 0
    iRule.FixesCount = 0
    iRule.TimeSpent = 0
    Call iRule.Increment
  Loop
End Function
