View Javadoc

1   /*
2    * $Id: MemoryStopwatchReport.java,v 1.1 2006/03/01 17:48:05 azzazzel Exp $
3    *
4    * Copyright 2006 Commsen International
5    * 
6    * Licensed under the Common Public License, Version 1.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    * 
10   *      http://www.opensource.org/licenses/cpl1.0.txt
11   * 
12   * THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
13   * EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS 
14   * OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
15   *
16   */
17  package com.commsen.stopwatch.reports;
18  
19  /***
20   * This report contains additional memory usage statistics. It is used by
21   * {@link com.commsen.stopwatch.engines.MemoryStopwatchEngine};
22   * 
23   * @author Milen Dyankov
24   */
25  public class MemoryStopwatchReport extends DefaultStopwatchReport {
26  
27  	private static final long serialVersionUID = 1L;
28  
29  	private long minMemory;
30  	private long maxMemory;
31  	private long averageMemory;
32  
33  
34  	/***
35  	 * @param group
36  	 * @param name
37  	 * @param count
38  	 * @param fastest
39  	 * @param slowest
40  	 * @param average
41  	 * @param total
42  	 * @param minMemory
43  	 * @param maxMemory
44  	 * @param averageMemory
45  	 */
46  	public MemoryStopwatchReport(String group, String name, long count, double fastest, double slowest, double average, double total, long minMemory, long maxMemory, long averageMemory) {
47  		super(group, name, count, fastest, slowest, average, total);
48  		this.minMemory = minMemory;
49  		this.maxMemory = maxMemory;
50  		this.averageMemory = averageMemory;
51  	}
52  
53  
54  	/***
55  	 * Generates string representation of this report
56  	 * 
57  	 * @see java.lang.Object#toString()
58  	 */
59  	public String toString() {
60  		return new StringBuffer(super.toString()).append("  MinMem=").append(minMemory).append("  AvgMem=").append(averageMemory).append("  MaxMem=").append(maxMemory).toString();
61  	}
62  
63  
64  	/***
65  	 * @return Returns the averageMemory.
66  	 */
67  	public long getAverageMemory() {
68  		return averageMemory;
69  	}
70  
71  
72  	/***
73  	 * @return Returns the maxMemory.
74  	 */
75  	public long getMaxMemory() {
76  		return maxMemory;
77  	}
78  
79  
80  	/***
81  	 * @return Returns the minMemory.
82  	 */
83  	public long getMinMemory() {
84  		return minMemory;
85  	}
86  
87  
88  	/*
89  	 * (non-Javadoc)
90  	 * 
91  	 * @see com.commsen.stopwatch.reports.DefaultStopwatchReport#equals(java.lang.Object)
92  	 */
93  	public boolean equals(Object obj) {
94  		// TODO Auto-generated method stub
95  		return super.equals(obj);
96  	}
97  
98  
99  	/*
100 	 * (non-Javadoc)
101 	 * 
102 	 * @see com.commsen.stopwatch.reports.DefaultStopwatchReport#hashCode()
103 	 */
104 	public int hashCode() {
105 		// TODO Auto-generated method stub
106 		return super.hashCode();
107 	}
108 
109 }