Class 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 org.apache.commons.collections.map.AbstractHashedMap

        org.apache.commons.collections.map.AbstractHashedMap.EntrySet, org.apache.commons.collections.map.AbstractHashedMap.EntrySetIterator, org.apache.commons.collections.map.AbstractHashedMap.HashEntry, org.apache.commons.collections.map.AbstractHashedMap.HashIterator, org.apache.commons.collections.map.AbstractHashedMap.HashMapIterator, org.apache.commons.collections.map.AbstractHashedMap.KeySet, org.apache.commons.collections.map.AbstractHashedMap.KeySetIterator, org.apache.commons.collections.map.AbstractHashedMap.Values, org.apache.commons.collections.map.AbstractHashedMap.ValuesIterator
    • Field Summary

      • Fields inherited from class org.apache.commons.collections.map.AbstractHashedMap

        data, DEFAULT_CAPACITY, DEFAULT_LOAD_FACTOR, DEFAULT_THRESHOLD, entrySet, GETKEY_INVALID, GETVALUE_INVALID, keySet, loadFactor, MAXIMUM_CAPACITY, modCount, NO_NEXT_ENTRY, NO_PREVIOUS_ENTRY, NULL, REMOVE_INVALID, SETVALUE_INVALID, size, threshold, values
    • Constructor Summary

      Constructors 
      Constructor Description
      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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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()  
      protected int hash​(Object key)  
      protected boolean isEqualKey​(Object key1, Object key2)  
      protected boolean isEqualValue​(Object value1, Object value2)  
      void put​(byte[] key, byte[] value)  
      • Methods inherited from class org.apache.commons.collections.map.AbstractHashedMap

        addEntry, addMapping, calculateNewCapacity, calculateThreshold, checkCapacity, clear, clone, containsKey, containsValue, convertKey, createEntry, createEntrySetIterator, createKeySetIterator, createValuesIterator, destroyEntry, doReadObject, doWriteObject, ensureCapacity, entryHashCode, entryKey, entryNext, entrySet, entryValue, equals, get, getEntry, hashCode, hashIndex, init, isEmpty, keySet, mapIterator, put, putAll, remove, removeEntry, removeMapping, reuseEntry, size, toString, updateEntry, values
    • 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

      • isEqualKey

        protected boolean isEqualKey​(Object key1,
                                     Object key2)
        Overrides:
        isEqualKey in class org.apache.commons.collections.map.AbstractHashedMap
      • isEqualValue

        protected boolean isEqualValue​(Object value1,
                                       Object value2)
        Overrides:
        isEqualValue in class org.apache.commons.collections.map.AbstractHashedMap
      • 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)
      • hash

        protected int hash​(Object key)
        Overrides:
        hash in class org.apache.commons.collections.map.AbstractHashedMap
      • getKeys

        public List<byte[]> getKeys()