LIDPavement.java [src/SwmmObjects] 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 SwmmObjects;

import java.text.DecimalFormat;
import org.apache.commons.lang3.StringUtils;

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

    /**
     * thickness of the pavement layer (inches or mm)
     */
    public double thick;
    /**
     * void ratio (volume of void space relative to the volume of solids in the
     * pavement for continuous systems or for the fill material used in modular
     * systems). Note that porosity = void ratio / (1 + void ratio).
     */
    public double vRatio;
    /**
     * ratio of impervious paver material to total area for modular systems; 0
     * for continuous porous pavement systems.
     */
    public double fracImp;
    /**
     * permeability of the concrete or asphalt used in continuous systems or
     * hydraulic conductivity of the fill material (gravel or sand) used in
     * modular systems (in/hr or mm/hr).
     */
    public double perm;
    /**
     * number of pavement layer void volumes of runoff treated it takes to
     * completely clog the pavement. Use a value of 0 to ignore clogging.
     */
    public double vClog;
    /**
     * No documentation exists yet.
     */
    public double regenInterval;
    /**
     * No documentation exists yet.
     */
    public double regenFrac;
    
    private DecimalFormat df = new DecimalFormat("#.###");

    public LIDPavement( double thick, double vRatio, double fracImp, double perm, double vClog, double regenInterval, double regenFrac )
    {
        this.thick = thick;
        this.vRatio = vRatio;
        this.fracImp = fracImp;
        this.perm = perm;
        this.vClog = vClog;
        this.regenInterval = regenInterval;
        this.regenFrac = regenFrac;
    }

    public String toString()
    {
        return toString( 17 );
    }

    public String toString( int padDistance )
    {
        StringBuilder sb = new StringBuilder();

        //Data
        sb.append( StringUtils.rightPad( df.format( this.thick ), padDistance ) );
        sb.append( StringUtils.rightPad( df.format( this.vRatio ), padDistance ) );
        sb.append( StringUtils.rightPad( df.format( this.fracImp ), padDistance ) );
        sb.append( StringUtils.rightPad( df.format( this.perm ), padDistance ) );
        sb.append( StringUtils.rightPad( df.format( this.vClog ), padDistance ) );
        sb.append( StringUtils.rightPad( df.format( this.regenInterval ), padDistance ) );
        sb.append( StringUtils.rightPad( df.format( this.regenFrac ), padDistance ) );

        return sb.toString();
    }
}