Package oshi.hardware.common
Class AbstractGlobalMemory
java.lang.Object
oshi.hardware.common.AbstractGlobalMemory
- All Implemented Interfaces:
GlobalMemory
- Direct Known Subclasses:
FreeBsdGlobalMemory,LinuxGlobalMemory,MacGlobalMemory,SolarisGlobalMemory,WindowsGlobalMemory
public abstract class AbstractGlobalMemory extends java.lang.Object implements GlobalMemory
Memory info.
-
Constructor Summary
Constructors Constructor Description AbstractGlobalMemory() -
Method Summary
Modifier and Type Method Description PhysicalMemory[]getPhysicalMemory()Physical memory, such as banks of memory.protected longparsePhysicalMemorySize(java.lang.String size)Parses a string such as "4096 MB" to its long.java.lang.StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface oshi.hardware.GlobalMemory
getAvailable, getPageSize, getTotal, getVirtualMemory
-
Constructor Details
-
AbstractGlobalMemory
public AbstractGlobalMemory()
-
-
Method Details
-
getPhysicalMemory
Description copied from interface:GlobalMemoryPhysical memory, such as banks of memory.On Linux, requires elevated permissions. On FreeBSD and Solaris, requires installation of dmidecode.
- Specified by:
getPhysicalMemoryin interfaceGlobalMemory- Returns:
- A list of PhysicalMemory objects.
-
parsePhysicalMemorySize
protected long parsePhysicalMemorySize(java.lang.String size)Parses a string such as "4096 MB" to its long. Used to parse macOS and *nix memory chip sizes. Although the units given are decimal they must parse to binary units.- Parameters:
size- A string of memory sizes like "4096 MB"- Returns:
- the size parsed to a long
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-