java怎么获取硬件信息(2)
java怎么获取硬件信息
public void setOsName(String osName) {
this.osName = osName;
}
public float getTotalMemorySize() {
return totalMemorySize;
}
public void setTotalMemorySize(float totalMemorySize) {
学习啦在线学习网 this.totalMemorySize = totalMemorySize;
}
学习啦在线学习网 public float getUsedMemory() {
return usedMemory;
}
public void setUsedMemory(long usedMemory) {
this.usedMemory = usedMemory;
}
public double getCpuRatio() {
return cpuRatio;
}
public void setCpuRatio(double cpuRatio) {
this.cpuRatio = cpuRatio;
}
学习啦在线学习网 public int compareTo(MonitorInfoBean m) {
学习啦在线学习网 String stra = this.getDDateTime();
String strb = m.getDDateTime();
Timestamp a = Timestamp.valueOf(stra);
Timestamp b = Timestamp.valueOf(strb);
if (a.before(b)) {
学习啦在线学习网 return -1;
学习啦在线学习网 } else if (a.after(b)) {
学习啦在线学习网 return 1;
学习啦在线学习网 } else {
学习啦在线学习网 return 0;
}
}
学习啦在线学习网 public float getMemoryRatio() {
学习啦在线学习网 return memoryRatio;
}
学习啦在线学习网 public void setMemoryRatio(float memoryRatio) {
this.memoryRatio = memoryRatio;
}
public void setUsedMemory(float usedMemory) {
this.usedMemory = usedMemory;
}
学习啦在线学习网 public void setBuffersMemory(float buffersMemory) {
this.buffersMemory = buffersMemory;
}
学习啦在线学习网 public void setCachedMemory(float cachedMemory) {
学习啦在线学习网 this.cachedMemory = cachedMemory;
}
}
学习啦在线学习网 import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
学习啦在线学习网 import java.io.IOException;
import java.io.InputStream;
学习啦在线学习网 import java.io.InputStreamReader;
import java.io.LineNumberReader;
学习啦在线学习网 import java.net.Inet6Address;
学习啦在线学习网 import java.net.InetAddress;
学习啦在线学习网 import java.net.NetworkInterface;
学习啦在线学习网 import java.net.SocketException;
学习啦在线学习网 import java.net.UnknownHostException;
import java.util.Enumeration;
学习啦在线学习网 import java.util.StringTokenizer;
import sun.management.ManagementFactory;
学习啦在线学习网 import com.sun.management.OperatingSystemMXBean;
/*采集系统采集数据实现类*/
/**
* @author Administrator
*
*/
看了“java怎么获取硬件信息”的内容的人还看: