edu.umd.cloud9.io.fastuil
Class String2FloatOpenHashMapWritable

java.lang.Object
  extended by it.unimi.dsi.fastutil.objects.AbstractObject2FloatFunction<K>
      extended by it.unimi.dsi.fastutil.objects.AbstractObject2FloatMap<K>
          extended by it.unimi.dsi.fastutil.objects.Object2FloatOpenHashMap<String>
              extended by edu.umd.cloud9.io.fastuil.String2FloatOpenHashMapWritable
All Implemented Interfaces:
Function<String,Float>, Hash, Object2FloatFunction<String>, Object2FloatMap<String>, Serializable, Cloneable, Map<String,Float>, Writable

public class String2FloatOpenHashMapWritable
extends Object2FloatOpenHashMap<String>
implements Writable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class it.unimi.dsi.fastutil.objects.AbstractObject2FloatMap
AbstractObject2FloatMap.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.Object2FloatMap
Object2FloatMap.Entry<K>, Object2FloatMap.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
String2FloatOpenHashMapWritable()
          Creates a String2IntOpenHashMapWritable object.
 
Method Summary
static String2FloatOpenHashMapWritable create(byte[] bytes)
          Returns the serialized representation of this object as a byte array.
static String2FloatOpenHashMapWritable create(DataInput in)
          Creates a OHMapSIW object from a DataInput.
 int dot(String2FloatOpenHashMapWritable m)
          Computes the dot product of this map with another map.
 void increment(String key)
          Increments the key.
 void plus(String2FloatOpenHashMapWritable 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.Object2FloatOpenHashMap
clear, clone, containsKey, containsValue, getFloat, growthFactor, growthFactor, hashCode, isEmpty, keySet, object2FloatEntrySet, put, put, rehash, remove, removeFloat, size, trim, trim, values
 
Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractObject2FloatMap
containsValue, entrySet, equals, putAll, toString
 
Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractObject2FloatFunction
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.Object2FloatFunction
defaultReturnValue, defaultReturnValue
 
Methods inherited from interface it.unimi.dsi.fastutil.Function
get
 
Methods inherited from interface java.util.Map
get
 

Constructor Detail

String2FloatOpenHashMapWritable

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

Parameters:
m - the other map

dot

public int dot(String2FloatOpenHashMapWritable 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