001 /** 002 ############################################################################## 003 ## ## 004 ## EnvInfo ## 005 ## ## 006 ## Copyright (C) 2009 Frederic Roudaut <frederic.roudaut@free.fr> ## 007 ## ## 008 ## This class is an adaption of the one done by Nicolas Richasse for his ## 009 ## Java Iperf frontend. ## 010 ## ## 011 ## ## 012 ## This program is free software: you can redistribute it and/or modify ## 013 ## it under the terms of the GNU General Public License as published by ## 014 ## the Free Software Foundation, either version 3 of the License, or ## 015 ## (at your option) any later version. ## 016 ## ## 017 ## This program is distributed in the hope that it will be useful, ## 018 ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## 019 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## 020 ## GNU General Public License for more details. ## 021 ## ## 022 ## You should have received a copy of the GNU General Public License ## 023 ## along with this program. If not, see <http://www.gnu.org/licenses/>. ## 024 ## ## 025 ## ## 026 ############################################################################## 027 **/ 028 029 package com.envInfo; 030 031 /** 032 * Class used to represent a single Memory Measurement. 033 * <br/><br/> 034 * This class is an adaption of the one done by Nicolas Richasse for his 035 * Java Iperf frontend. 036 * 037 **/ 038 public class MemoryMeasurement 039 { 040 private double start; 041 private double end; 042 private double value; 043 private String units; 044 045 /** 046 * Constructor. 047 * @param start the start time of the measurement. 048 * @param end the end time of the measurement. 049 * @param value the memory value. 050 * @param units the memory Units. 051 * 052 **/ 053 public MemoryMeasurement(double start, double end, double value, String units) 054 { 055 this.start = start; 056 this.end = end; 057 this.value = value; 058 this.units = units; 059 } 060 061 /** 062 * Return the start time. 063 * @return the start time. 064 * 065 **/ 066 public double getStartTime() 067 { 068 return start; 069 } 070 071 /** 072 * Return the end time. 073 * @return the end time. 074 * 075 **/ 076 public double getEndTime() 077 { 078 return end; 079 } 080 081 /** 082 * Return the measurement value. 083 * @return the measurement value. 084 * 085 **/ 086 public double getValue() 087 { 088 return value; 089 } 090 091 /** 092 * Return the measurement unit. 093 * @return the measurement unit. 094 * 095 **/ 096 public String getUnits() 097 { 098 return units; 099 } 100 101 /** 102 * Print the measurement content. 103 * 104 **/ 105 public void print() 106 { 107 System.out.println("Start Time: " + start); 108 System.out.println("End Time: " + end); 109 System.out.println("Value: " + value); 110 System.out.println("Units: " + units); 111 } 112 }