a-foundation/src/main/java/com/ajjpj/afoundation/collection/immutable/AListMap.java
public static <K,V> AListMap<K,V> fromKeysAndValues(AEquality equality, Iterable<K> keys, Iterable<V> values) {
        final Iterator<K> ki = keys.iterator();
        final Iterator<V> vi = values.iterator();

        AListMap<K,V> result = empty (equality);

        while(ki.hasNext()) {
            final K key = ki.next();
            final V value = vi.next();

            result = result.updated(key, value);
        }
        return result;
    }
public static <K,V> AListMap<K,V> fromKeysAndValues(AEquality equality, Iterable<K> keys, Iterable<V> values) {
        final Iterator<K> ki = keys.iterator();
        final Iterator<V> vi = values.iterator();

        AListMap<K,V> result = empty (equality);

        while(ki.hasNext()) {
            final K key = ki.next();
            final V value = vi.next();

            result = result.updated(key, value);
        }
        return result;
    }
public static < K , V > AListMap < K , V > fromKeysAndValues ( AEquality equality , Iterable < K > keys , Iterable < V > values ) { final Iterator < K > ki = keys . iterator ( ) ; final Iterator < V > vi = values . iterator ( ) ; AListMap < K , V > result = empty ( equality ) ; while ( ki . hasNext ( ) ) { final K key = ki . next ( ) ; final V value = vi . next ( ) ; result = result . updated ( key , value ) ; } return result ; }
Returns an AListMap instance with a given equalityForEquals, initializing it from separate 'keys'
and 'values' collections. Both collections are iterated exactly once, and are expected to have the same size.
Returns an AListMap instance with a given equalityForEquals initializing it from separate keys and values collections . Both collections are iterated exactly once and are expected to have the same size .