1 /*
2 Bloof - visualize the evolution of your software project
3 Copyright ( C ) 2003 Lukasz Pekacki <lukasz@pekacki.de>
4 http://bloof.sf.net/
5
6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along with
15 this program; if not, write to the Free Software Foundation, Inc.,
16 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18 $RCSfile: DownloadEvent.java,v $
19 Created on $Date: 2003/10/13 18:05:07 $
20 */
21 package net.sf.bloof.websuite.util;
22
23 import java.net.URL;
24
25 /***
26 * Event object for a download event
27 * @author Lukasz Pekacki <pekacki@users.sourceforge.net>
28 * @version $Id: DownloadEvent.java,v 1.1 2003/10/13 18:05:07 pekacki Exp $
29 */
30 public class DownloadEvent {
31 /***
32 * Main constructor
33 * @param aType Type of the Event, eigher DownloadEvent.START, DownloadEvent.RUNNING
34 * or DownloadEvent.END
35 * @param aTotalSize size of the file in bytes
36 * @param aAlreadyDownloaded already downloaded bytes
37 * @param aFileName name of the file
38 * @param aSource URL of the source
39 */
40 public DownloadEvent(
41 int aType,
42 int aTotalSize,
43 int aAlreadyDownloaded,
44 String aFileName,
45 URL aSource) {
46 this.mType = aType;
47 this.mTotalSize = aTotalSize;
48 this.mAlreadyDownloaded = aAlreadyDownloaded;
49 this.mFileName = aFileName;
50 this.mSource = aSource;
51 }
52 /***
53 * Returns the alreadyDownloaded bytes
54 * @return int
55 */
56 public int getAlreadyDownloaded() {
57 double ts = mAlreadyDownloaded;
58 return (int) ts;
59 }
60
61 /***
62 * Returns the fileName.
63 * @return String
64 */
65 public String getFileName() {
66 return mFileName;
67 }
68
69 /***
70 * Returns the URL of the source.
71 * @return URL
72 */
73 public URL getSource() {
74 return mSource;
75 }
76
77 /***
78 * Returns the totalSize in bytes
79 * @return int totalSize in bytes
80 */
81 public int getTotalSize() {
82 double ts = mTotalSize;
83 return (int) ts;
84 }
85
86 /***
87 * Returns the type of event. Can be DownloadEvent.START, DownloadEvent.RUNNING or DownloadEvent.END
88 * @return int type of event. Can be DownloadEvent.START, DownloadEvent.RUNNING or DownloadEvent.END
89 */
90 public int getType() {
91 return mType;
92 }
93 /***
94 * Event types
95 * */
96 public static final int END = 2, RUNNING = 1, START = 0;
97 private int mAlreadyDownloaded;
98 private String mFileName;
99 private URL mSource;
100 private int mTotalSize;
101 private int mType;
102
103 }
This page was automatically generated by Maven