org.apache.mahout.cf.taste.impl.common
Class FastByIDMap<V>
java.lang.Object
org.apache.mahout.cf.taste.impl.common.FastByIDMap<V>
- All Implemented Interfaces:
- Serializable, Cloneable
public final class FastByIDMap<V>
- extends Object
- implements Serializable, Cloneable
- See Also:
FastMap
,
FastIDSet
,
Serialized Form
NO_MAX_SIZE
public static final int NO_MAX_SIZE
- See Also:
- Constant Field Values
FastByIDMap
public FastByIDMap()
- Creates a new
FastByIDMap
with default capacity.
FastByIDMap
public FastByIDMap(int size)
FastByIDMap
public FastByIDMap(int size,
float loadFactor)
FastByIDMap
public FastByIDMap(int size,
int maxSize)
FastByIDMap
public FastByIDMap(int size,
int maxSize,
float loadFactor)
- Creates a new
FastByIDMap
whose capacity can accommodate the given number of entries without rehash.
- Parameters:
size
- desired capacitymaxSize
- max capacityloadFactor
- ratio of internal hash table size to current size
- Throws:
IllegalArgumentException
- if size is less than 0, maxSize is less than 1
or at least half of RandomUtils.MAX_INT_SMALLER_TWIN_PRIME
, or
loadFactor is less than 1
get
public V get(long key)
size
public int size()
isEmpty
public boolean isEmpty()
containsKey
public boolean containsKey(long key)
containsValue
public boolean containsValue(Object value)
put
public V put(long key,
V value)
remove
public V remove(long key)
clear
public void clear()
keySetIterator
public LongPrimitiveIterator keySetIterator()
entrySet
public Set<Map.Entry<Long,V>> entrySet()
values
public Collection<V> values()
rehash
public void rehash()
clone
public FastByIDMap<V> clone()
- Overrides:
clone
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
equals
public boolean equals(Object other)
- Overrides:
equals
in class Object
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.