tl.lin.data.map
Class Object2IntOpenHashMapWritable<K extends org.apache.hadoop.io.Writable>

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

public class Object2IntOpenHashMapWritable<K extends org.apache.hadoop.io.Writable>
extends it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<K>
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
Object2IntOpenHashMapWritable()
          Creates a String2IntOpenHashMapWritable object.
 
Method Summary
static
<K extends org.apache.hadoop.io.Writable>
Object2IntOpenHashMapWritable<K>
create(byte[] bytes)
          Creates object from serialized representation.
static
<K extends org.apache.hadoop.io.Writable>
Object2IntOpenHashMapWritable<K>
create(DataInput in)
          Creates object from serialized representation.
 int dot(Object2IntOpenHashMapWritable<K> m)
          Computes the dot product of this map with another map.
 void increment(K key)
          Increments the key.
 void plus(Object2IntOpenHashMapWritable<K> 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
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

Object2IntOpenHashMapWritable

public Object2IntOpenHashMapWritable()
Creates a String2IntOpenHashMapWritable object.

Method Detail

readFields

public void readFields(DataInput in)
                throws IOException
Deserializes the map.

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 the map.

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
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 org.apache.hadoop.io.Writable> Object2IntOpenHashMapWritable<K> 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 <K extends org.apache.hadoop.io.Writable> Object2IntOpenHashMapWritable<K> create(byte[] bytes)
                                                                                     throws IOException
Creates object from serialized representation.

Parameters:
bytes - source of serialized representation
Returns:
newly-created 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


Copyright © 2013. All Rights Reserved.