tl.lin.data.map
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 tl.lin.data.map.String2IntOpenHashMapWritable
All Implemented Interfaces:
it.unimi.dsi.fastutil.Function<String,Integer>, it.unimi.dsi.fastutil.Hash, it.unimi.dsi.fastutil.objects.Object2IntFunction<String>, it.unimi.dsi.fastutil.objects.Object2IntMap<String>, Serializable, Cloneable, Map<String,Integer>, org.apache.hadoop.io.Writable

public class String2IntOpenHashMapWritable
extends it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<String>
implements org.apache.hadoop.io.Writable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class it.unimi.dsi.fastutil.objects.AbstractObject2IntMap
it.unimi.dsi.fastutil.objects.AbstractObject2IntMap.BasicEntry<K>
 
Nested classes/interfaces inherited from interface it.unimi.dsi.fastutil.Hash
it.unimi.dsi.fastutil.Hash.Strategy<K>
 
Nested classes/interfaces inherited from interface it.unimi.dsi.fastutil.objects.Object2IntMap
it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<K>, it.unimi.dsi.fastutil.objects.Object2IntMap.FastEntrySet<K>
 
Field Summary
 
Fields inherited from class it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap
entries, f, key, keys, mask, maxFill, n, size, used, value, values
 
Fields inherited from class it.unimi.dsi.fastutil.objects.AbstractObject2IntFunction
defRetValue
 
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)
          Creates object from serialized representation.
static String2IntOpenHashMapWritable create(DataInput in)
          Creates object from serialized representation.
 int dot(String2IntOpenHashMapWritable m)
          Computes the dot product of this map with another map.
 void increment(String key)
          Increments the key.
 void increment(String key, int n)
          Increments the key.
 void plus(String2IntOpenHashMapWritable m)
          Adds values of keys from another map to this map.
 void readFields(DataInput in)
          Deserializes this object.
 byte[] serialize()
          Serializes this object to a byte array.
 void write(DataOutput out)
          Serializes this object.
 
Methods inherited from class it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap
add, addTo, clear, clone, containsKey, containsValue, getInt, growthFactor, growthFactor, hashCode, isEmpty, keySet, object2IntEntrySet, put, put, rehash, rehash, remove, removeInt, shiftKeys, 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
finalize, 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 this object.

Specified by:
readFields in interface org.apache.hadoop.io.Writable
Parameters:
in - source for raw byte representation
Throws:
IOException

write

public void write(DataOutput out)
           throws IOException
Serializes this object.

Specified by:
write in interface org.apache.hadoop.io.Writable
Parameters:
out - where to write the raw byte representation
Throws:
IOException

serialize

public byte[] serialize()
                 throws IOException
Serializes this object to a byte array.

Returns:
byte array representing the serialized representation
Throws:
IOException

create

public static String2IntOpenHashMapWritable create(DataInput in)
                                            throws IOException
Creates object from serialized representation.

Parameters:
in - source of serialized representation
Returns:
newly-created object
Throws:
IOException

create

public static String2IntOpenHashMapWritable create(byte[] bytes)
                                            throws IOException
Creates object from serialized representation.

Returns:
byte array representing the serialized representation
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

increment

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

Parameters:
key - key to increment
n - amount to increment


Copyright © 2013. All Rights Reserved.