|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.archive.crawler.settings.SoftSettingsHash
public class SoftSettingsHash
Nested Class Summary | |
---|---|
(package private) class |
SoftSettingsHash.EntryIterator
Iterator over all elements in hash. |
(package private) static class |
SoftSettingsHash.SettingsEntry
The entries in this hash extend SoftReference, using the host string as the key. |
Constructor Summary | |
---|---|
SoftSettingsHash(int initialCapacity)
Constructs a new, empty SoftSettingsHash with the given initial capacity. |
Method Summary | |
---|---|
void |
clear()
Removes all settings object from this hash. |
(package private) static boolean |
eq(java.lang.Object x,
java.lang.Object y)
Check for equality of non-null reference x and possibly-null y. |
CrawlerSettings |
get(java.lang.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. |
(package private) static int |
hash(java.lang.String key)
Make hash value from a String. |
(package private) static int |
indexFor(int h,
int length)
Return index for hash code h. |
SoftSettingsHash.EntryIterator |
iterator()
|
CrawlerSettings |
put(SoftSettingsHash.SettingsEntry entry)
|
CrawlerSettings |
put(java.lang.String key,
CrawlerSettings settings)
Associates the specified settings object with the specified key in this hash. |
java.lang.Object |
remove(java.lang.String key)
Removes the settings object identified by the key from this hash if present. |
(package private) void |
resize(int newCapacity)
Rehashes the contents of this hash into a new HashMap instance with a larger capacity. |
int |
size()
Returns the number of key-value mappings in this map. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SoftSettingsHash(int initialCapacity)
initialCapacity
- The initial capacity of the
SoftSettingsHash
java.lang.IllegalArgumentException
- If the initial capacity is negative.Method Detail |
---|
static boolean eq(java.lang.Object x, java.lang.Object y)
static int indexFor(int h, int length)
public int size()
public CrawlerSettings get(java.lang.String key)
key
- the key whose associated settings object is to be returned.
put(String, CrawlerSettings)
public CrawlerSettings put(java.lang.String key, CrawlerSettings settings)
key
- key with which the specified settings object is to be
associated.settings
- settings object to be associated with the specified key.
public CrawlerSettings put(SoftSettingsHash.SettingsEntry entry)
void resize(int newCapacity)
newCapacity
- the new capacity, MUST be a power of two.public java.lang.Object remove(java.lang.String key)
key
- key whose element is to be removed from the hash.
public void clear()
static int hash(java.lang.String key)
key
- the string for which to create hash value.
public SoftSettingsHash.EntryIterator iterator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |