學(xué)習(xí)啦>學(xué)習(xí)電腦>電腦硬件知識>硬件知識> java怎么獲取硬件信息(2)

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

時間: 捷鋒774 分享

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;

  /*采集系統(tǒng)采集數(shù)據(jù)實現(xiàn)類*/

  /**

  * @author Administrator

  *

  */

看了“java怎么獲取硬件信息”的內(nèi)容的人還看:

1.android怎么獲取硬件信息

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

3.linux如何查看硬件信息

4.java簡歷項目經(jīng)驗怎么寫

5.java簡歷項目技術(shù)怎么描述

6.java內(nèi)存溢出如何產(chǎn)生

7.基于Web的網(wǎng)絡(luò)多媒體CAI課件的設(shè)計與開發(fā)

836239