org.pentaho.di.core.hash
Class ByteArrayHashMap

java.lang.Object
  extended by java.util.AbstractMap
      extended by org.apache.commons.collections.map.AbstractHashedMap
          extended by org.pentaho.di.core.hash.ByteArrayHashMap
All Implemented Interfaces:
Map, org.apache.commons.collections.IterableMap

public class ByteArrayHashMap
extends org.apache.commons.collections.map.AbstractHashedMap


Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
ByteArrayHashMap(int initialCapacity, float loadFactor, RowMetaInterface keyMeta)
          Constructs an empty ByteArrayHashMap with the specified initial capacity and load factor.
ByteArrayHashMap(int initialCapacity, RowMetaInterface keyMeta)
          Constructs an empty ByteArrayHashMap with the specified initial capacity and the default load factor (0.75).
ByteArrayHashMap(RowMetaInterface keyMeta)
          Constructs an empty HashMap with the default initial capacity (16) and the default load factor (0.75).
 
Method Summary
 boolean equalsByteArray(byte[] value, byte[] cmpValue)
           
 byte[] get(byte[] key)
          Returns the entry to which the specified key is "mapped", or, in other words, if this index contains an entry that is equal to the given key, or null if this is not the case.
 List<byte[]> getKeys()
           
 void put(byte[] key, byte[] value)
           
 
Methods inherited from class org.apache.commons.collections.map.AbstractHashedMap
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, mapIterator, put, putAll, remove, size, toString, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ByteArrayHashMap

public ByteArrayHashMap(int initialCapacity,
                        float loadFactor,
                        RowMetaInterface keyMeta)
Constructs an empty ByteArrayHashMap with the specified initial capacity and load factor.

Parameters:
initialCapacity - the initial capacity
loadFactor - the load factor
Throws:
IllegalArgumentException - if the initial capacity is negative or the load factor is nonpositive

ByteArrayHashMap

public ByteArrayHashMap(int initialCapacity,
                        RowMetaInterface keyMeta)
Constructs an empty ByteArrayHashMap with the specified initial capacity and the default load factor (0.75).

Parameters:
initialCapacity - the initial capacity.
Throws:
IllegalArgumentException - if the initial capacity is negative.

ByteArrayHashMap

public ByteArrayHashMap(RowMetaInterface keyMeta)
Constructs an empty HashMap with the default initial capacity (16) and the default load factor (0.75).

Method Detail

equalsByteArray

public final boolean equalsByteArray(byte[] value,
                                     byte[] cmpValue)

get

public byte[] get(byte[] key)
Returns the entry to which the specified key is "mapped", or, in other words, if this index contains an entry that is equal to the given key, or null if this is not the case.

More formally, if this index contains an entry e such that key.equals(e)), then this method returns e; otherwise it returns null. (There can be at most one such entry.)

Parameters:
key - The key to look up.
Throws:
KettleValueException - in case of a value conversion error
See Also:
#put(Object), #insert(Object)

put

public void put(byte[] key,
                byte[] value)

getKeys

public List<byte[]> getKeys()