1
2
3
4
5 package oshi.hardware.common;
6
7 import oshi.annotation.concurrent.ThreadSafe;
8 import oshi.hardware.VirtualMemory;
9 import oshi.util.FormatUtil;
10
11
12
13
14 @ThreadSafe
15 public abstract class AbstractVirtualMemory implements VirtualMemory {
16
17 @Override
18 public String toString() {
19 StringBuilder sb = new StringBuilder();
20 sb.append("Swap Used/Avail: ");
21 sb.append(FormatUtil.formatBytes(getSwapUsed()));
22 sb.append("/");
23 sb.append(FormatUtil.formatBytes(getSwapTotal()));
24 sb.append(", Virtual Memory In Use/Max=");
25 sb.append(FormatUtil.formatBytes(getVirtualInUse()));
26 sb.append("/");
27 sb.append(FormatUtil.formatBytes(getVirtualMax()));
28 return sb.toString();
29 }
30 }