Class CentralProcessor.ProcessorCache

java.lang.Object
oshi.hardware.CentralProcessor.ProcessorCache
Enclosing interface:
CentralProcessor

@PublicApi @Immutable public static class CentralProcessor.ProcessorCache extends Object
A class representing CPU Cache Memory.
  • Constructor Details

    • ProcessorCache

      public ProcessorCache(byte level, byte associativity, short lineSize, int cacheSize, CentralProcessor.ProcessorCache.Type type)
      Creates a ProcessorCache with the given parameters.
      Parameters:
      level - the cache level (1, 2, 3, or 4)
      associativity - the cache associativity
      lineSize - the cache line size in bytes
      cacheSize - the cache size in bytes
      type - the cache type
    • ProcessorCache

      public ProcessorCache(int level, int associativity, int lineSize, long cacheSize, CentralProcessor.ProcessorCache.Type type)
      Creates a ProcessorCache with the given parameters, casting to appropriate types.
      Parameters:
      level - the cache level (1, 2, 3, or 4)
      associativity - the cache associativity
      lineSize - the cache line size in bytes
      cacheSize - the cache size in bytes
      type - the cache type
  • Method Details

    • getLevel

      public byte getLevel()
      The cache level. This member can be 1 (L1), 2 (L2), 3 (L3), or 4 (L4).
      Returns:
      the level
    • getAssociativity

      public byte getAssociativity()
      The cache associativity. If this member is 0xFF, the cache is fully associative.
      Returns:
      the associativity
    • getLineSize

      public short getLineSize()
      The cache line size, in bytes.
      Returns:
      the line size
    • getCacheSize

      public int getCacheSize()
      The cache size, in bytes.
      Returns:
      the cache size
    • getType

      The cache type.
      Returns:
      the type
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object