All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opentripplanner.netex.loader.util.ReadOnlyHierarchicalMap Maven / Gradle / Ivy

There is a newer version: 2.5.0
Show newest version
package org.opentripplanner.netex.loader.util;

/**
 * Read only interface for a hierarchical map. This interface proved a interface to a hierarchy of
 * maps with a parent - child relationship. Elements are retrieved using ({@link #lookup(Object)}).
 * The lookup call check the current instance, then the parent to find an element. This continue
 * until the root of the hierarchy is reached. If a {@code key} exist in more than two places in
 * the hierarchy, the first value found wins.
 *
 * @param  The key type
 * @param  Thr value type
 */
public interface ReadOnlyHierarchicalMap {

    /**
     * Lookup element, if not found delegate up to the parent.
     * NB! elements of this class and its parents are NOT merged, the closest win.
     * @return an empty collection if no element are found.
     */
    V lookup(K key);

    /**
     * The key exist in this Collection or one of the parents (parent, parent´s parent and so on)
     */
    boolean containsKey(K key);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy