SwmmReport.java [src/SwmmReportObjects] Revision: default  Date:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package SwmmReportObjects;

import java.util.ArrayList;

/**
 *
 * @author Lucas Yaege
 */
public class SwmmReport {

    public ArrayList<SubcatchmentRunoffSummary> runoffSummaries;
    public ArrayList<OutfallLoadingSummary> outfallLoadingSummaries;
    public ArrayList<LIDPerformanceSummary> lidPerformanceSummaries;

    public SwmmReport()
    {
        runoffSummaries = new ArrayList<>();
        outfallLoadingSummaries = new ArrayList<>();
        lidPerformanceSummaries = new ArrayList<>();
    }

    public OutfallLoadingSummary getOutfallLoadingSummaryByID( String id ) throws Exception
    {
        OutfallLoadingSummary result = null;
        for ( OutfallLoadingSummary o : outfallLoadingSummaries )
        {
            if ( o.outfall.equalsIgnoreCase( id ) )
            {
                result = o;
            }
        }
        if ( result == null )
        {
            throw new Exception( "No Outfall Found with name: " + id );
        }

        return result;
    }

    public LIDPerformanceSummary getLIDPerformanceSummaryByID( String name ) throws Exception
    {
        LIDPerformanceSummary result = null;
        for ( LIDPerformanceSummary lps : lidPerformanceSummaries )
        {
            if ( lps.LIDControl.equalsIgnoreCase( name ) )
            {
                result = lps;
            }
        }
        if ( result == null )
        {
            throw new Exception( "No Outfall Found with name: " + name );
        }

        return result;
    }

}