Package oshi.hardware
Class CentralProcessor.ProcessorCache
- java.lang.Object
-
- oshi.hardware.CentralProcessor.ProcessorCache
-
- Enclosing interface:
- CentralProcessor
@Immutable public static class CentralProcessor.ProcessorCache extends java.lang.Object
A class representing CPU Cache Memory.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CentralProcessor.ProcessorCache.Type
The type of cache.
-
Field Summary
Fields Modifier and Type Field Description private byte
associativity
private int
cacheSize
private byte
level
private short
lineSize
private CentralProcessor.ProcessorCache.Type
type
-
Constructor Summary
Constructors Constructor Description ProcessorCache(byte level, byte associativity, short lineSize, int cacheSize, CentralProcessor.ProcessorCache.Type type)
ProcessorCache(int level, int associativity, int lineSize, long cacheSize, CentralProcessor.ProcessorCache.Type type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
byte
getAssociativity()
The cache associativity.int
getCacheSize()
The cache size, in bytes.byte
getLevel()
The cache level.short
getLineSize()
The cache line size, in bytes.CentralProcessor.ProcessorCache.Type
getType()
The cache type.int
hashCode()
java.lang.String
toString()
-
-
-
Field Detail
-
level
private final byte level
-
associativity
private final byte associativity
-
lineSize
private final short lineSize
-
cacheSize
private final int cacheSize
-
type
private final CentralProcessor.ProcessorCache.Type type
-
-
Constructor Detail
-
ProcessorCache
public ProcessorCache(byte level, byte associativity, short lineSize, int cacheSize, CentralProcessor.ProcessorCache.Type type)
-
ProcessorCache
public ProcessorCache(int level, int associativity, int lineSize, long cacheSize, CentralProcessor.ProcessorCache.Type type)
-
-
Method Detail
-
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 is0xFF
, 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
public CentralProcessor.ProcessorCache.Type getType()
The cache type.- Returns:
- the type
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-