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 classCentralProcessor.ProcessorCache.TypeThe type of cache.
-
Field Summary
Fields Modifier and Type Field Description private byteassociativityprivate intcacheSizeprivate bytelevelprivate shortlineSizeprivate CentralProcessor.ProcessorCache.Typetype
-
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 booleanequals(java.lang.Object obj)bytegetAssociativity()The cache associativity.intgetCacheSize()The cache size, in bytes.bytegetLevel()The cache level.shortgetLineSize()The cache line size, in bytes.CentralProcessor.ProcessorCache.TypegetType()The cache type.inthashCode()java.lang.StringtoString()
-
-
-
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:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-