edu.umd.cloud9.io.fastuil
Class String2IntOpenHashMapWritable

java.lang.Object
  extended by it.unimi.dsi.fastutil.objects.AbstractObject2IntFunction<K>
      extended by it.unimi.dsi.fastutil.objects.AbstractObject2IntMap<K>
          extended by it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<String>
              extended by edu.umd.cloud9.io.fastuil.String2IntOpenHashMapWritable
All Implemented Interfaces:
Function<String,Integer>, Hash, Object2IntFunction<String>, Object2IntMap<String>, Serializable, Cloneable, Map<String,Integer>, Writable

public class String2IntOpenHashMapWritable
extends Object2IntOpenHashMap<String>
implements Writable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class it.unimi.dsi.fastutil.objects.AbstractObject2IntMap
AbstractObject2IntMap.BasicEntry<K>
 
Nested classes/interfaces inherited from interface it.unimi.dsi.fastutil.Hash
Hash.Strategy<K>
 
Nested classes/interfaces inherited from interface it.unimi.dsi.fastutil.objects.Object2IntMap
Object2IntMap.Entry<K>, Object2IntMap.FastEntrySet<K>
 
Field Summary
 
Fields inherited from interface it.unimi.dsi.fastutil.Hash
DEFAULT_GROWTH_FACTOR, DEFAULT_INITIAL_SIZE, DEFAULT_LOAD_FACTOR, FAST_LOAD_FACTOR, FREE, OCCUPIED, PRIMES, REMOVED, VERY_FAST_LOAD_FACTOR
 
Constructor Summary
String2IntOpenHashMapWritable()
          Creates a String2IntOpenHashMapWritable object.
 
Method Summary
static String2IntOpenHashMapWritable create(byte[] bytes)
          Returns the serialized representation of this object as a byte array.
static String2IntOpenHashMapWritable create(DataInput in)
          Creates a OHMapSIW object from a DataInput.
 int dot(String2IntOpenHashMapWritable m)
          Computes the dot product of this map with another map.
 void increment(String key)
          Increments the key.
 void plus(String2IntOpenHashMapWritable m)
          Adds values of keys from another map to this map.
 void readFields(DataInput in)
          Deserializes the map.
 byte[] serialize()
          Returns the serialized representation of this object as a byte array.
 void write(DataOutput out)
          Serializes the map.
 
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 class it.unimi.dsi.fastutil.objects.AbstractObject2IntMap
containsValue, entrySet, equals, putAll, toString
 
Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractObject2IntFunction
defaultReturnValue, defaultReturnValue, get
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.fastutil.objects.Object2IntFunction
defaultReturnValue, defaultReturnValue
 
Methods inherited from interface it.unimi.dsi.fastutil.Function
get
 
Methods inherited from interface java.util.Map
get
 

Constructor Detail

String2IntOpenHashMapWritable

public String2IntOpenHashMapWritable()
Creates a String2IntOpenHashMapWritable object.

Method Detail

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 String2IntOpenHashMapWritable 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 String2IntOpenHashMapWritable 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(String2IntOpenHashMapWritable m)
Adds values of keys from another map to this map.

Parameters:
m - the other map

dot

public int dot(String2IntOpenHashMapWritable m)
Computes the dot product of this map with another map.

Parameters:
m - the other map

increment

public void increment(String key)
Increments the key. If the key does not exist in the map, its value is set to one.

Parameters:
key - key to increment