/*
 * @(#)PopMessageProgressEvent.java
 *
 * Copyright (c) 2001-2002 JScape
 * 1147 S. 53rd Pl., Mesa, Arizona, 85206, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * JScape. ("Confidential Information").  You shall not disclose such
 * Confidential Information and shall use it only in accordance with
 * the terms of the license agreement you entered into with JScape.
 */
package com.jscape.inet.pop;

import java.util.EventObject;


/**
 * Fired frequently during the progress of downloading a message from POP server.
 */
public class PopMessageProgressEvent
        extends EventObject {

    private int msg;
    private long bytes;
    private long totalBytes;

    /**
     * Creates PopMessageProgressEvent.
     *
     * @param source     the source of the event
     * @param msg        the message index for this event
     * @param bytes      the total number of bytes transferred so far
     * @param totalBytes the total size of message in bytes
     */
    public PopMessageProgressEvent(Object source, int msg, long bytes, long totalBytes) {
        super(source);
        this.msg = msg;
        this.bytes = bytes;
        this.totalBytes = totalBytes;
    }

    /**
     * Gets number of bytes transferred for message so far.
     *
     * @return number of bytes transferred
     */
    public long getBytes() {
        return bytes;
    }

    /**
     * Gets total message size in bytes.
     *
     * @return total size of message in bytes
     */
    public long getTotalBytes() {
        return totalBytes;
    }

    /**
     * Gets the corresponding message index for this event.
     *
     * @return the message index
     */
    public int getMessageIndex() {
        return msg;
    }

}
