// Decompiled by DJ v2.6.6.51 Copyright 2000 Atanas Neshkov  Date: 10/2/2001 11:01:01
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   com/macromedia/generator/utils/GenReportFrame

package com.macromedia.generator.utils;


public class GenReportFrame
{

    public GenReportFrame()
    {
        _fld0283 = null;
        _fld0284 = null;
        startupTime = null;
        currentTime = 0L;
        statTime = 0L;
        maxConcurReq = 0L;
        swfCnt = 0L;
        swfTotSize = 0L;
        swfTotTime = 0L;
        swfMaxSize = 0L;
        swfMaxTime = 0L;
        jpgCnt = 0L;
        jpgTotSize = 0L;
        jpgTotTime = 0L;
        jpgMaxSize = 0L;
        jpgMaxTime = 0L;
        pngCnt = 0L;
        pngTotSize = 0L;
        pngTotTime = 0L;
        pngMaxSize = 0L;
        pngMaxTime = 0L;
        gifCnt = 0L;
        gifTotSize = 0L;
        gifTotTime = 0L;
        gifMaxSize = 0L;
        gifMaxTime = 0L;
        xgifCnt = 0L;
        xgifTotSize = 0L;
        xgifTotTime = 0L;
        xgifMaxSize = 0L;
        xgifMaxTime = 0L;
        qtmCnt = 0L;
        qtmTotSize = 0L;
        qtmTotTime = 0L;
        qtmMaxSize = 0L;
        qtmMaxTime = 0L;
    }

    public GenReportFrame(long al[], String s)
    {
        _fld0283 = null;
        _fld0284 = null;
        startupTime = null;
        currentTime = 0L;
        statTime = 0L;
        maxConcurReq = 0L;
        swfCnt = 0L;
        swfTotSize = 0L;
        swfTotTime = 0L;
        swfMaxSize = 0L;
        swfMaxTime = 0L;
        jpgCnt = 0L;
        jpgTotSize = 0L;
        jpgTotTime = 0L;
        jpgMaxSize = 0L;
        jpgMaxTime = 0L;
        pngCnt = 0L;
        pngTotSize = 0L;
        pngTotTime = 0L;
        pngMaxSize = 0L;
        pngMaxTime = 0L;
        gifCnt = 0L;
        gifTotSize = 0L;
        gifTotTime = 0L;
        gifMaxSize = 0L;
        gifMaxTime = 0L;
        xgifCnt = 0L;
        xgifTotSize = 0L;
        xgifTotTime = 0L;
        xgifMaxSize = 0L;
        xgifMaxTime = 0L;
        qtmCnt = 0L;
        qtmTotSize = 0L;
        qtmTotTime = 0L;
        qtmMaxSize = 0L;
        qtmMaxTime = 0L;
        _fld0283 = null;
        _fld0284 = null;
        _mth0283(al, s);
    }

    public long getGifAvgSize()
    {
        return gifCnt <= 0L ? 0L : ((gifTotSize + (gifCnt >> 1)) / gifCnt + 500L) / 1000L;
    }

    public long getGifAvgTime()
    {
        return gifCnt <= 0L ? 0L : gifTotTime / gifCnt;
    }

    public long getGifCnt()
    {
        return gifCnt;
    }

    public long getGifMaxSize()
    {
        return gifMaxSize;
    }

    public long getGifMaxTime()
    {
        return gifMaxTime;
    }

    public long getJpgAvgSize()
    {
        return jpgCnt <= 0L ? 0L : ((jpgTotSize + (jpgCnt >> 1)) / jpgCnt + 500L) / 1000L;
    }

    public long getJpgAvgTime()
    {
        return jpgCnt <= 0L ? 0L : jpgTotTime / jpgCnt;
    }

    public long getJpgCnt()
    {
        return jpgCnt;
    }

    public long getJpgMaxSize()
    {
        return jpgMaxSize;
    }

    public long getJpgMaxTime()
    {
        return jpgMaxTime;
    }

    public long getMidTime()
    {
        long l = currentTime + (statTime >> 1);
        return l;
    }

    public long getPngAvgSize()
    {
        return pngCnt <= 0L ? 0L : ((pngTotSize + (pngCnt >> 1)) / pngCnt + 500L) / 1000L;
    }

    public long getPngAvgTime()
    {
        return pngCnt <= 0L ? 0L : pngTotTime / pngCnt;
    }

    public long getPngCnt()
    {
        return pngCnt;
    }

    public long getPngMaxSize()
    {
        return pngMaxSize;
    }

    public long getPngMaxTime()
    {
        return pngMaxTime;
    }

    public long getQtmAvgSize()
    {
        return qtmCnt <= 0L ? 0L : ((qtmTotSize + (qtmCnt >> 1)) / qtmCnt + 500L) / 1000L;
    }

    public long getQtmAvgTime()
    {
        return qtmCnt <= 0L ? 0L : qtmTotTime / qtmCnt;
    }

    public long getQtmCnt()
    {
        return qtmCnt;
    }

    public long getQtmMaxSize()
    {
        return qtmMaxSize;
    }

    public long getQtmMaxTime()
    {
        return qtmMaxTime;
    }

    public long getSwfAvgSize()
    {
        return swfCnt <= 0L ? 0L : ((swfTotSize + (swfCnt >> 1)) / swfCnt + 500L) / 1000L;
    }

    public long getSwfAvgTime()
    {
        return swfCnt <= 0L ? 0L : swfTotTime / swfCnt;
    }

    public long getSwfCnt()
    {
        return swfCnt;
    }

    public long getSwfMaxSize()
    {
        return swfMaxSize;
    }

    public long getSwfMaxTime()
    {
        return swfMaxTime;
    }

    public String getWriteString()
    {
        String s = ",";
        String s1 = startupTime;
        s1 = s1 + s + currentTime;
        long l = System.currentTimeMillis() - currentTime;
        s1 = s1 + s + l;
        s1 = s1 + s + maxConcurReq;
        s1 = s1 + s + getSwfCnt();
        s1 = s1 + s + swfTotSize;
        s1 = s1 + s + swfTotTime;
        s1 = s1 + s + getSwfMaxSize();
        s1 = s1 + s + getSwfMaxTime();
        s1 = s1 + s + getGifCnt();
        s1 = s1 + s + gifTotSize;
        s1 = s1 + s + gifTotTime;
        s1 = s1 + s + getGifMaxSize();
        s1 = s1 + s + getGifMaxTime();
        s1 = s1 + s + getJpgCnt();
        s1 = s1 + s + jpgTotSize;
        s1 = s1 + s + jpgTotTime;
        s1 = s1 + s + getJpgMaxSize();
        s1 = s1 + s + getJpgMaxTime();
        s1 = s1 + s + getPngCnt();
        s1 = s1 + s + pngTotSize;
        s1 = s1 + s + pngTotTime;
        s1 = s1 + s + getPngMaxSize();
        s1 = s1 + s + getPngMaxTime();
        s1 = s1 + s + getQtmCnt();
        s1 = s1 + s + qtmTotSize;
        s1 = s1 + s + qtmTotTime;
        s1 = s1 + s + getQtmMaxSize();
        s1 = s1 + s + getQtmMaxTime();
        return s1;
    }

    public boolean isEmpty()
    {
        if(statTime > 0L)
            return false;
        if(maxConcurReq != 0L)
            return false;
        if(swfCnt > 0L)
            return false;
        if(gifCnt > 0L)
            return false;
        if(jpgCnt > 0L)
            return false;
        if(pngCnt > 0L)
            return false;
        return qtmCnt <= 0L;
    }

    public void mergeFrame(GenReportFrame genreportframe)
    {
        statTime += genreportframe.statTime;
        if(genreportframe.maxConcurReq > maxConcurReq)
            maxConcurReq = genreportframe.maxConcurReq;
        if(genreportframe.swfCnt > 0L)
        {
            swfTotSize += genreportframe.swfTotSize;
            swfTotTime += genreportframe.swfTotTime;
            if(genreportframe.swfMaxSize > swfMaxSize)
                swfMaxSize = genreportframe.swfMaxSize;
            if(genreportframe.swfMaxTime > swfMaxTime)
                swfMaxTime = genreportframe.swfMaxTime;
            swfCnt += genreportframe.swfCnt;
        }
        if(genreportframe.gifCnt > 0L)
        {
            gifTotSize += genreportframe.gifTotSize;
            gifTotTime += genreportframe.gifTotTime;
            if(genreportframe.gifMaxSize > gifMaxSize)
                gifMaxSize = genreportframe.gifMaxSize;
            if(genreportframe.gifMaxTime > gifMaxTime)
                gifMaxTime = genreportframe.gifMaxTime;
            gifCnt += genreportframe.gifCnt;
        }
        if(genreportframe.jpgCnt > 0L)
        {
            jpgTotSize += genreportframe.jpgTotSize;
            jpgTotTime += genreportframe.jpgTotTime;
            if(genreportframe.jpgMaxSize > jpgMaxSize)
                jpgMaxSize = genreportframe.jpgMaxSize;
            if(genreportframe.jpgMaxTime > jpgMaxTime)
                jpgMaxTime = genreportframe.jpgMaxTime;
            jpgCnt += genreportframe.jpgCnt;
        }
        if(genreportframe.pngCnt > 0L)
        {
            pngTotSize += genreportframe.pngTotSize;
            pngTotTime += genreportframe.pngTotTime;
            if(genreportframe.pngMaxSize > pngMaxSize)
                pngMaxSize = genreportframe.pngMaxSize;
            if(genreportframe.pngMaxTime > pngMaxTime)
                pngMaxTime = genreportframe.pngMaxTime;
            pngCnt += genreportframe.pngCnt;
        }
        if(genreportframe.qtmCnt > 0L)
        {
            qtmTotSize += genreportframe.qtmTotSize;
            qtmTotTime += genreportframe.qtmTotTime;
            if(genreportframe.qtmMaxSize > qtmMaxSize)
                qtmMaxSize = genreportframe.qtmMaxSize;
            if(genreportframe.qtmMaxTime > qtmMaxTime)
                qtmMaxTime = genreportframe.qtmMaxTime;
            qtmCnt += genreportframe.qtmCnt;
        }
    }

    public boolean parseReadString(String s)
    {
        String s1 = null;
        long al[] = new long[31];
        byte byte0 = 29;
        for(int i = 1; i <= byte0; i++)
        {
            if(s == null || s.length() == 0)
                return false;
            int j = s.indexOf(44);
            String s2 = j < 0 ? s : s.substring(0, j);
            s = j < 0 ? null : s.substring(j + 1);
            try
            {
                switch(i)
                {
                case 1: // '\001'
                    s1 = s2;
                    break;

                default:
                    al[i] = Long.parseLong(s2);
                    break;
                }
            }
            catch(NumberFormatException _ex)
            {
                return false;
            }
        }

        _mth0283(al, s1);
        return true;
    }

    public void resetValues(String s)
    {
        startupTime = s;
        currentTime = System.currentTimeMillis();
        statTime = 0L;
        maxConcurReq = 0L;
        swfCnt = 0L;
        swfTotSize = 0L;
        swfTotTime = 0L;
        swfMaxSize = 0L;
        swfMaxTime = 0L;
        gifCnt = 0L;
        gifTotSize = 0L;
        gifTotTime = 0L;
        gifMaxSize = 0L;
        gifMaxTime = 0L;
        jpgCnt = 0L;
        jpgTotSize = 0L;
        jpgTotTime = 0L;
        jpgMaxSize = 0L;
        jpgMaxTime = 0L;
        pngCnt = 0L;
        pngTotSize = 0L;
        pngTotTime = 0L;
        pngMaxSize = 0L;
        pngMaxTime = 0L;
        qtmCnt = 0L;
        qtmTotSize = 0L;
        qtmTotTime = 0L;
        qtmMaxSize = 0L;
        qtmMaxTime = 0L;
    }

    private void _mth0283(long al[], String s)
    {
        startupTime = s;
        currentTime = al[2];
        statTime = al[3];
        maxConcurReq = al[4];
        swfCnt = al[5];
        swfTotSize = al[6];
        swfTotTime = al[7];
        swfMaxSize = al[8];
        swfMaxTime = al[9];
        gifCnt = al[10];
        gifTotSize = al[11];
        gifTotTime = al[12];
        gifMaxSize = al[13];
        gifMaxTime = al[14];
        jpgCnt = al[15];
        jpgTotSize = al[16];
        jpgTotTime = al[17];
        jpgMaxSize = al[18];
        jpgMaxTime = al[19];
        pngCnt = al[20];
        pngTotSize = al[21];
        pngTotTime = al[22];
        pngMaxSize = al[23];
        pngMaxTime = al[24];
        qtmCnt = al[25];
        qtmTotSize = al[26];
        qtmTotTime = al[27];
        qtmMaxSize = al[28];
        qtmMaxTime = al[29];
    }

    GenReportFrame _fld0283;
    GenReportFrame _fld0284;
    public String startupTime;
    public long currentTime;
    public long statTime;
    public long maxConcurReq;
    public long swfCnt;
    public long swfTotSize;
    public long swfTotTime;
    public long swfMaxSize;
    public long swfMaxTime;
    public long jpgCnt;
    public long jpgTotSize;
    public long jpgTotTime;
    public long jpgMaxSize;
    public long jpgMaxTime;
    public long pngCnt;
    public long pngTotSize;
    public long pngTotTime;
    public long pngMaxSize;
    public long pngMaxTime;
    public long gifCnt;
    public long gifTotSize;
    public long gifTotTime;
    public long gifMaxSize;
    public long gifMaxTime;
    public long xgifCnt;
    public long xgifTotSize;
    public long xgifTotTime;
    public long xgifMaxSize;
    public long xgifMaxTime;
    public long qtmCnt;
    public long qtmTotSize;
    public long qtmTotTime;
    public long qtmMaxSize;
    public long qtmMaxTime;
}