edu.umd.cloud9.io.fastuil
Class Object2FloatOpenHashMapWritable<K extends Writable>
java.lang.Object
it.unimi.dsi.fastutil.objects.AbstractObject2FloatFunction<K>
it.unimi.dsi.fastutil.objects.AbstractObject2FloatMap<K>
it.unimi.dsi.fastutil.objects.Object2FloatOpenHashMap<K>
edu.umd.cloud9.io.fastuil.Object2FloatOpenHashMapWritable<K>
- All Implemented Interfaces:
- Function<K,Float>, Hash, Object2FloatFunction<K>, Object2FloatMap<K>, Serializable, Cloneable, Map<K,Float>, Writable
public class Object2FloatOpenHashMapWritable<K extends Writable>
- extends Object2FloatOpenHashMap<K>
- implements Writable
- See Also:
- Serialized Form
| Nested classes/interfaces inherited from interface it.unimi.dsi.fastutil.Hash |
Hash.Strategy<K> |
| Methods inherited from class it.unimi.dsi.fastutil.objects.Object2FloatOpenHashMap |
clear, clone, containsKey, containsValue, getFloat, growthFactor, growthFactor, hashCode, isEmpty, keySet, object2FloatEntrySet, put, put, rehash, remove, removeFloat, size, trim, trim, values |
| Methods inherited from interface it.unimi.dsi.fastutil.Function |
get |
| Methods inherited from interface java.util.Map |
get |
Object2FloatOpenHashMapWritable
public Object2FloatOpenHashMapWritable()
- Creates a
String2IntOpenHashMapWritable object.
readFields
public void readFields(DataInput in)
throws IOException
- Deserializes the map.
- Specified by:
readFields in interface Writable
- Parameters:
in - source for raw byte representation
- Throws:
IOException
write
public void write(DataOutput out)
throws IOException
- Serializes the map.
- Specified by:
write in interface Writable
- Parameters:
out - where to write the raw byte representation
- Throws:
IOException
serialize
public byte[] serialize()
throws IOException
- Returns the serialized representation of this object as a byte array.
- Returns:
- byte array representing the serialized representation of this
object
- Throws:
IOException
create
public static <K extends Writable> Object2FloatOpenHashMapWritable<K> create(DataInput in)
throws IOException
- Creates a
OHMapSIW object from a DataInput.
- Parameters:
in - DataInput for reading the serialized
representation
- Returns:
- a newly-created
OHMapSIW object
- Throws:
IOException
create
public static <K extends Writable> Object2FloatOpenHashMapWritable<K> create(byte[] bytes)
throws IOException
- Returns the serialized representation of this object as a byte array.
- Returns:
- byte array representing the serialized representation of this
object
- Throws:
IOException
plus
public void plus(Object2FloatOpenHashMapWritable<K> m)
- Adds values of keys from another map to this map.
- Parameters:
m - the other map
dot
public int dot(Object2FloatOpenHashMapWritable<K> m)
- Computes the dot product of this map with another map.
- Parameters:
m - the other map
increment
public void increment(K key)
- Increments the key. If the key does not exist in the map, its value is
set to one.
- Parameters:
key - key to increment