学习啦>学习电脑>电脑硬件知识>硬件知识>

java怎么获取硬件信息(2)

捷锋分享

  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怎么获取硬件信息”的内容的人还看:

1.android怎么获取硬件信息

2.c #怎么获取硬件信息

3.linux如何查看硬件信息

4.java简历项目经验怎么写

5.java简历项目技术怎么描述

6.java内存溢出如何产生

7.基于Web的网络多媒体CAI课件的设计与开发

836239