| java.lang.Object org.archive.crawler.settings.SoftSettingsHash
SoftSettingsHash | public class SoftSettingsHash (Code) | | |
Inner Class :static class SettingsEntry extends SoftReference | |
Inner Class :class EntryIterator implements Iterator | |
Constructor Summary | |
public | SoftSettingsHash(int initialCapacity) Constructs a new, empty SoftSettingsHash with the given initial
capacity. |
Method Summary | |
public void | clear() Removes all settings object from this hash. | static boolean | eq(Object x, Object y) Check for equality of non-null reference x and possibly-null y. | public CrawlerSettings | get(String key) Returns the value to which the specified key is mapped in this weak
hash map, or null if the map contains no mapping for
this key. | static int | hash(String key) Make hash value from a String.
Parameters: key - the string for which to create hash value. | static int | indexFor(int h, int length) Return index for hash code h. | public EntryIterator | iterator() | public CrawlerSettings | put(String key, CrawlerSettings settings) Associates the specified settings object with the specified key in this
hash.
If the hash previously contained a settings object for this key, the old
object is replaced.
Parameters: key - key with which the specified settings object is to beassociated. Parameters: settings - settings object to be associated with the specified key. | public CrawlerSettings | put(SettingsEntry entry) | public Object | remove(String key) Removes the settings object identified by the key from this hash if
present.
Parameters: key - key whose element is to be removed from the hash. | void | resize(int newCapacity) Rehashes the contents of this hash into a new HashMap instance
with a larger capacity. | public int | size() Returns the number of key-value mappings in this map. |
SoftSettingsHash | public SoftSettingsHash(int initialCapacity)(Code) | | Constructs a new, empty SoftSettingsHash with the given initial
capacity.
Parameters: initialCapacity - The initial capacity of theSoftSettingsHash throws: IllegalArgumentException - If the initial capacity is negative. |
clear | public void clear()(Code) | | Removes all settings object from this hash.
|
eq | static boolean eq(Object x, Object y)(Code) | | Check for equality of non-null reference x and possibly-null y. By
default uses Object.equals.
|
get | public CrawlerSettings get(String key)(Code) | | Returns the value to which the specified key is mapped in this weak
hash map, or null if the map contains no mapping for
this key. Null is also returned if the element has been GC'ed.
Parameters: key - the key whose associated settings object is to be returned. the settings object represented by the key, ornull if the map contains no mapping for this key. See Also: SoftSettingsHash.put(String,CrawlerSettings) |
hash | static int hash(String key)(Code) | | Make hash value from a String.
Parameters: key - the string for which to create hash value. the hash value. |
indexFor | static int indexFor(int h, int length)(Code) | | Return index for hash code h.
|
iterator | public EntryIterator iterator()(Code) | | |
put | public CrawlerSettings put(String key, CrawlerSettings settings)(Code) | | Associates the specified settings object with the specified key in this
hash.
If the hash previously contained a settings object for this key, the old
object is replaced.
Parameters: key - key with which the specified settings object is to beassociated. Parameters: settings - settings object to be associated with the specified key. previous value associated with specified key, or nullif there was no mapping for key. |
remove | public Object remove(String key)(Code) | | Removes the settings object identified by the key from this hash if
present.
Parameters: key - key whose element is to be removed from the hash. previous value associated with specified key, or nullif there was no mapping for key. |
resize | void resize(int newCapacity)(Code) | | Rehashes the contents of this hash into a new HashMap instance
with a larger capacity. This method is called automatically when the
number of keys in this map exceeds its capacity and load factor.
Note that this method is a no-op if it's called with newCapacity ==
2*MAXIMUM_CAPACITY (which is Integer.MIN_VALUE).
Parameters: newCapacity - the new capacity, MUST be a power of two. |
size | public int size()(Code) | | Returns the number of key-value mappings in this map.
This result is a snapshot, and may not reflect unprocessed
entries that will be removed before next attempted access
because they are no longer referenced.
|
|
|