Package com.alachisoft.ncache.runtime
Enum CacheItemPriority
- java.lang.Object
-
- java.lang.Enum<CacheItemPriority>
-
- com.alachisoft.ncache.runtime.CacheItemPriority
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<CacheItemPriority>
public enum CacheItemPriority extends java.lang.Enum<CacheItemPriority>
Specifies the relative priority of items stored in the cache. When the application's cache is full or runs low on memory, the cache selectively purges items to free the system memory. When an item is added to the cache, you can assign it a relative priority compared to the other items stored in the cache. The items you assign higher priority values are less likely to be deleted from the cache when the server is processing a large number of requests, while items you assign lower priority values are more likely to be deleted. The default value is Normal.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AboveNormalCache items with this priority level are less likely to be deleted as the server frees system memory than those assigned a Normal priority.BelowNormalCache items with this priority level are more likely to be deleted from the cache as the server frees system memory than items assigned a Normal priority.DefaultThe default value for a cached item's priority is Normal.HighCache items with this priority level are least likely to be deleted from the cache as the server frees system memory.LowCache items with this priority level are most likely to be deleted from the cache as the server frees system memory.NormalCache items with this priority level are likely to be deleted from the cache as the server frees system memory only after those items with Low or BelowNormal priority.NotRemovableThe cache items with this priority level will not be deleted from the cache as the server frees system memory.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CacheItemPriorityforValue(int value)Retrieves the enum constant of the specified value, if exists.static CacheItemPrioritygetValueFromString(java.lang.String value)Retrieves the enum constant of the specified value, if exists.intvalue()Order is important in enums.static CacheItemPriorityvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static CacheItemPriority[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
Normal
public static final CacheItemPriority Normal
Cache items with this priority level are likely to be deleted from the cache as the server frees system memory only after those items with Low or BelowNormal priority. This is the default value.
-
Low
public static final CacheItemPriority Low
Cache items with this priority level are most likely to be deleted from the cache as the server frees system memory.
-
BelowNormal
public static final CacheItemPriority BelowNormal
Cache items with this priority level are more likely to be deleted from the cache as the server frees system memory than items assigned a Normal priority.
-
AboveNormal
public static final CacheItemPriority AboveNormal
Cache items with this priority level are less likely to be deleted as the server frees system memory than those assigned a Normal priority.
-
High
public static final CacheItemPriority High
Cache items with this priority level are least likely to be deleted from the cache as the server frees system memory.
-
NotRemovable
public static final CacheItemPriority NotRemovable
The cache items with this priority level will not be deleted from the cache as the server frees system memory.
-
Default
public static final CacheItemPriority Default
The default value for a cached item's priority is Normal.
-
-
Method Detail
-
values
public static CacheItemPriority[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CacheItemPriority c : CacheItemPriority.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CacheItemPriority valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
forValue
public static CacheItemPriority forValue(int value)
Retrieves the enum constant of the specified value, if exists.- Parameters:
value- Enum constant index.- Returns:
- Enum constant.
-
value
public int value()
Order is important in enums. By using Value() method, each enum constant index can be found, just like array index.- Returns:
- Enum constant index.
-
getValueFromString
public static CacheItemPriority getValueFromString(java.lang.String value)
Retrieves the enum constant of the specified value, if exists.- Parameters:
value- Enum constant index.- Returns:
- Enum constant.
-
-