Package oshi.hardware

Class CentralProcessor.ProcessorIdentifier

  • Enclosing interface:
    CentralProcessor

    @Immutable
    public static final class CentralProcessor.ProcessorIdentifier
    extends java.lang.Object
    A class encapsulating ghe CPU's identifier strings ,including name, vendor, stepping, model, and family information (also called the signature of a CPU)
    • Constructor Summary

      Constructors 
      Constructor Description
      ProcessorIdentifier​(java.lang.String cpuVendor, java.lang.String cpuName, java.lang.String cpuFamily, java.lang.String cpuModel, java.lang.String cpuStepping, java.lang.String processorID, boolean cpu64bit)  
      ProcessorIdentifier​(java.lang.String cpuVendor, java.lang.String cpuName, java.lang.String cpuFamily, java.lang.String cpuModel, java.lang.String cpuStepping, java.lang.String processorID, boolean cpu64bit, long vendorFreq)  
    • Field Detail

      • OSHI_ARCHITECTURE_PROPERTIES

        private static final java.lang.String OSHI_ARCHITECTURE_PROPERTIES
        See Also:
        Constant Field Values
      • cpuVendor

        private final java.lang.String cpuVendor
      • cpuName

        private final java.lang.String cpuName
      • cpuFamily

        private final java.lang.String cpuFamily
      • cpuModel

        private final java.lang.String cpuModel
      • cpuStepping

        private final java.lang.String cpuStepping
      • processorID

        private final java.lang.String processorID
      • cpuIdentifier

        private final java.lang.String cpuIdentifier
      • cpu64bit

        private final boolean cpu64bit
      • cpuVendorFreq

        private final long cpuVendorFreq
      • microArchictecture

        private final java.util.function.Supplier<java.lang.String> microArchictecture
    • Constructor Detail

      • ProcessorIdentifier

        public ProcessorIdentifier​(java.lang.String cpuVendor,
                                   java.lang.String cpuName,
                                   java.lang.String cpuFamily,
                                   java.lang.String cpuModel,
                                   java.lang.String cpuStepping,
                                   java.lang.String processorID,
                                   boolean cpu64bit)
      • ProcessorIdentifier

        public ProcessorIdentifier​(java.lang.String cpuVendor,
                                   java.lang.String cpuName,
                                   java.lang.String cpuFamily,
                                   java.lang.String cpuModel,
                                   java.lang.String cpuStepping,
                                   java.lang.String processorID,
                                   boolean cpu64bit,
                                   long vendorFreq)
    • Method Detail

      • getVendor

        public java.lang.String getVendor()
        Processor vendor.
        Returns:
        vendor string.
      • getName

        public java.lang.String getName()
        Name, eg. Intel(R) Core(TM)2 Duo CPU T7300 @ 2.00GHz
        Returns:
        Processor name.
      • getFamily

        public java.lang.String getFamily()
        Gets the family. For non-Intel/AMD processors, returns the comparable value, such as the Architecture.
        Returns:
        the family
      • getModel

        public java.lang.String getModel()
        Gets the model. For non-Intel/AMD processors, returns the comparable value, such as the Partnum.
        Returns:
        the model
      • getStepping

        public java.lang.String getStepping()
        Gets the stepping. For non-Intel/AMD processors, returns the comparable value, such as the rnpn composite of Variant and Revision.
        Returns:
        the stepping
      • getProcessorID

        public java.lang.String getProcessorID()
        Gets the Processor ID. This is a hexidecimal string representing an 8-byte value, normally obtained using the CPUID opcode with the EAX register set to 1. The first four bytes are the resulting contents of the EAX register, which is the Processor signature, represented in human-readable form by getIdentifier() . The remaining four bytes are the contents of the EDX register, containing feature flags.

        For processors that do not support the CPUID opcode this field is populated with a comparable hex string. For example, ARM Processors will fill the first 32 bytes with the MIDR. AIX PowerPC Processors will return the machine ID.

        NOTE: The order of returned bytes is platform and software dependent. Values may be in either Big Endian or Little Endian order.

        NOTE: If OSHI is unable to determine the ProcessorID from native sources, it will attempt to reconstruct one from available information in the processor identifier.

        Returns:
        A string representing the Processor ID
      • getIdentifier

        public java.lang.String getIdentifier()
        Identifier, eg. x86 Family 6 Model 15 Stepping 10. For non-Intel/AMD processors, this string is populated with comparable values.
        Returns:
        Processor identifier.
      • isCpu64bit

        public boolean isCpu64bit()
        Is CPU 64bit?
        Returns:
        True if cpu is 64bit.
      • getVendorFreq

        public long getVendorFreq()
        Vendor frequency (in Hz), eg. for processor named Intel(R) Core(TM)2 Duo CPU T7300 @ 2.00GHz the vendor frequency is 2000000000.
        Returns:
        Processor frequency or -1 if unknown.
      • getMicroarchitecture

        public java.lang.String getMicroarchitecture()
        Returns the processor's microarchitecture, if known.
        Returns:
        A string containing the microarchitecture if known. Constants.UNKNOWN otherwise.
      • queryMicroarchitecture

        private java.lang.String queryMicroarchitecture()
      • queryVendorFromImplementer

        private java.lang.String queryVendorFromImplementer​(java.lang.String cpuVendor)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object