---
title: clsHazardGroupCollection
summary: API reference for clsHazardGroupCollection.
status: draft
owner: Technical Writer
last_reviewed: 2026-07-31
library: SAIF.Business.Policy
reference_type: package
---

# clsHazardGroupCollection

`clsHazardGroupCollection` is a read-only business collection (`clsBusinessCollection(Of clsHazardGroup)`) that retrieves the set of `clsHazardGroup` records effective as of a given date from the `HAZARD_GROUP` table, per [BR-POL-012](../../../../business-rules.md#br-pol-012-hazard-groups-are-filtered-by-effective-date-window). Editing, removal, and general saving are disabled at construction (`AllowEdit = False`, `AllowRemove = False`), consistent with hazard-group data being read-only, per [BR-POL-011](../../../../business-rules.md#br-pol-011-hazard-group-data-is-read-only).

## Purpose
- Retrieve all `clsHazardGroup` records whose effective/expiration date window contains a supplied `EffectiveDate`, via `GetHazardGroups`, per [BR-POL-012](../../../../business-rules.md#br-pol-012-hazard-groups-are-filtered-by-effective-date-window).
- Provide indexed (`Item`) and keyed (`ItemByKey`) lookup of hazard groups by position or `HazardGroupID`, consistent with hazard-group identity being the ID alone, per [BR-POL-016](../../../../business-rules.md#br-pol-016-hazard-group-identity-is-the-hazard-group-id-only).
- Support membership checks (`Contains`, `ContainsDeleted`) and removal (`Remove`) against the in-memory collection, by object or by `HazardGroupID`.
- Report the collection itself as always valid and never independently savable, reflecting the read-only nature of hazard-group data, per [BR-POL-011](../../../../business-rules.md#br-pol-011-hazard-group-data-is-read-only).

## Context
- Namespace: `SAIF.Business.Policy`
- Assembly/package: `SAIF.Business.Policy`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| `Item` | `Default Public Overloads ReadOnly Property Item(ByVal Index As Integer) As clsHazardGroup` | The default indexer, returning the `clsHazardGroup` at the specified position. |
| `ItemByKey` | `Public ReadOnly Property ItemByKey(ByVal inHazardGroupID As String) As clsHazardGroup` | Returns the `clsHazardGroup` matching the specified `HazardGroupID`, or `Nothing` if not found. |
| `MyCriteria` | `Public ReadOnly Property MyCriteria() As Criteria` | The nested `Criteria` object used to retrieve this collection. |
| `IsValid` | `Public Overrides ReadOnly Property IsValid() As Boolean` | Always returns `True`; the collection has no independent validation rules. |
| `IsSavable` | `Public ReadOnly Property IsSavable() As Boolean` | Always returns `False`; the collection cannot be saved, consistent with hazard groups being read-only, per [BR-POL-011](../../../../business-rules.md#br-pol-011-hazard-group-data-is-read-only). |
| `Contains(inObject)` | `Public Overloads Function Contains(ByVal inObject As clsHazardGroup) As Boolean` | Returns `True` if an equal `clsHazardGroup` exists in the collection. |
| `Contains(inHazardGroupID)` | `Public Overloads Function Contains(ByVal inHazardGroupID As String) As Boolean` | Returns `True` if a `clsHazardGroup` with the specified ID exists in the collection. |
| `ContainsDeleted(inObject)` | `Public Overloads Function ContainsDeleted(ByVal inObject As clsHazardGroup) As Boolean` | Returns `True` if an equal `clsHazardGroup` exists in the collection's deleted-items list. |
| `ContainsDeleted(inHazardGroupID)` | `Public Overloads Function ContainsDeleted(ByVal inHazardGroupID As String) As Boolean` | Returns `True` if a `clsHazardGroup` with the specified ID exists in the collection's deleted-items list. |
| `Remove(inObject)` | `Public Overloads Sub Remove(ByVal inObject As clsHazardGroup)` | Removes the specified `clsHazardGroup` from the collection. |
| `Remove(inHazardGroupID)` | `Public Overloads Sub Remove(ByVal inHazardGroupID As String)` | Removes the `clsHazardGroup` matching the specified ID from the collection. |
| `GetHazardGroupCollection` | `<Obsolete("Use GetHazardGroups instead.")> Public Shared Function GetHazardGroupCollection(ByVal inDataportal As IDataPortalInfo, ByVal inEffectiveDate As Date) As clsHazardGroupCollection` | Retrieves the hazard-group collection effective as of the supplied date. **Obsolete** — superseded by `GetHazardGroups`. |
| `GetHazardGroups` | `Public Shared Function GetHazardGroups(ByVal inDataportal As IDataPortalInfo, ByVal inEffectiveDate As Date) As clsHazardGroupCollection` | Retrieves the hazard-group collection effective as of the supplied date, per [BR-POL-012](../../../../business-rules.md#br-pol-012-hazard-groups-are-filtered-by-effective-date-window). This is the current, non-obsolete entry point. |

## Inherited public members

| Member | Signature | Purpose | Origin |
| --- | --- | --- | --- |
| First | `Sub First()` | Moves the inherited collection traversal cursor to the first item* | `SAIF.Framework.Core` — `clsBusinessCollectionBase` |

## Behavioral notes
- Source declaration: `Business\SAIF.Business.Policy\clsHazardGroupCollection.vb`.
- Related operations, rules, and SQL are cross-referenced from the library-level documentation.

## Constraints and usage notes
- Consumers should rely on the declared public surface rather than internal implementation details.

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Sources
- `Business\SAIF.Business.Policy\clsHazardGroupCollection.vb`
