提交 c312a2dd authored 作者: noelgrandin's avatar noelgrandin

minor spelling and grammar fixes

上级 f4e7837e
...@@ -18,7 +18,7 @@ import java.util.Set; ...@@ -18,7 +18,7 @@ import java.util.Set;
* A scan resistant cache. It is meant to cache objects that are relatively * A scan resistant cache. It is meant to cache objects that are relatively
* costly to acquire, for example file content. * costly to acquire, for example file content.
* <p> * <p>
* This implementation is multi-threading save and supports concurrent access. * This implementation is multi-threading safe and supports concurrent access.
* Null keys or null values are not allowed. The map fill factor is at most 75%. * Null keys or null values are not allowed. The map fill factor is at most 75%.
* <p> * <p>
* Each entry is assigned a distinct memory size, and the cache will try to use * Each entry is assigned a distinct memory size, and the cache will try to use
...@@ -84,7 +84,7 @@ public class CacheConcurrentLIRS<K, V> extends AbstractMap<K, V> implements Map< ...@@ -84,7 +84,7 @@ public class CacheConcurrentLIRS<K, V> extends AbstractMap<K, V> implements Map<
/** /**
* Check whether there is a resident entry for the given key. This method * Check whether there is a resident entry for the given key. This method
* does not adjusts the internal state of the cache. * does not adjust the internal state of the cache.
* *
* @param key the key (may not be null) * @param key the key (may not be null)
* @return true if there is a resident entry * @return true if there is a resident entry
...@@ -321,7 +321,7 @@ public class CacheConcurrentLIRS<K, V> extends AbstractMap<K, V> implements Map< ...@@ -321,7 +321,7 @@ public class CacheConcurrentLIRS<K, V> extends AbstractMap<K, V> implements Map<
} }
/** /**
* Get the list of keys. This method allows to view the internal state of * Get the list of keys. This method allows a view of the internal state of
* the cache. * the cache.
* *
* @param cold if true, only keys for the cold entries are returned * @param cold if true, only keys for the cold entries are returned
...@@ -477,7 +477,7 @@ public class CacheConcurrentLIRS<K, V> extends AbstractMap<K, V> implements Map< ...@@ -477,7 +477,7 @@ public class CacheConcurrentLIRS<K, V> extends AbstractMap<K, V> implements Map<
V get(Object key, int hash) { V get(Object key, int hash) {
Entry<K, V> e = find(key, hash); Entry<K, V> e = find(key, hash);
if (e == null) { if (e == null) {
// either the entry was not found // the entry was not found
return null; return null;
} }
V value = e.value; V value = e.value;
...@@ -511,7 +511,7 @@ public class CacheConcurrentLIRS<K, V> extends AbstractMap<K, V> implements Map< ...@@ -511,7 +511,7 @@ public class CacheConcurrentLIRS<K, V> extends AbstractMap<K, V> implements Map<
if (e.isHot()) { if (e.isHot()) {
if (e != stack.stackNext) { if (e != stack.stackNext) {
if (stackMoveDistance == 0 || stackMoveCounter - e.topMove > stackMoveDistance) { if (stackMoveDistance == 0 || stackMoveCounter - e.topMove > stackMoveDistance) {
// move a hot entries to the top of the stack // move a hot entry to the top of the stack
// unless it is already there // unless it is already there
boolean wasEnd = e == stack.stackPrev; boolean wasEnd = e == stack.stackPrev;
removeFromStack(e); removeFromStack(e);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论