com.ajjpj.afoundation.collection.immutable.AListMap Maven / Gradle / Ivy
The newest version!
package com.ajjpj.afoundation.collection.immutable;
import com.ajjpj.afoundation.collection.AEquality;
import com.ajjpj.afoundation.collection.tuples.ATuple2;
import com.ajjpj.afoundation.function.AFunction1;
import java.io.Serializable;
import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Objects;
/**
* This AMap implementation stores entries in a linked list, giving all lookup operations O(n) complexity. That makes
* AHashMap the better choice most of the time.
*
* This class is however useful when keys are known to have the same hash codes (e.g. deep in the innards of AHashMap),
* or if control over iteration order is desirable.
*
* @author arno
*/
public class AListMap extends AbstractAMap implements AMapEntry {
private static final AEquality DEFAULT_EQUALITY = AEquality.EQUALS;
private static final AListMap