edu.umd.cloud9.io.fastuil
Class Object2IntOpenHashMapWritable<K extends Writable>
java.lang.Object
it.unimi.dsi.fastutil.objects.AbstractObject2IntFunction<K>
it.unimi.dsi.fastutil.objects.AbstractObject2IntMap<K>
it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<K>
edu.umd.cloud9.io.fastuil.Object2IntOpenHashMapWritable<K>
- All Implemented Interfaces:
- Function<K,Integer>, Hash, Object2IntFunction<K>, Object2IntMap<K>, Serializable, Cloneable, Map<K,Integer>, Writable
public class Object2IntOpenHashMapWritable<K extends Writable>
- extends Object2IntOpenHashMap<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.Object2IntOpenHashMap |
clear, clone, containsKey, containsValue, getInt, growthFactor, growthFactor, hashCode, isEmpty, keySet, object2IntEntrySet, put, put, rehash, remove, removeInt, size, trim, trim, values |
| Methods inherited from interface it.unimi.dsi.fastutil.Function |
get |
| Methods inherited from interface java.util.Map |
get |
Object2IntOpenHashMapWritable
public Object2IntOpenHashMapWritable()
- 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> Object2IntOpenHashMapWritable<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> Object2IntOpenHashMapWritable<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(Object2IntOpenHashMapWritable<K> m)
- Adds values of keys from another map to this map.
- Parameters:
m - the other map
dot
public int dot(Object2IntOpenHashMapWritable<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