001/* 002 * ModeShape (http://www.modeshape.org) 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.modeshape.common.collection; 017 018import java.util.List; 019import java.util.Map; 020 021/** 022 * A collection similar to {@link Map}, but which may associate multiple values with any single key. 023 * <p> 024 * Some implementation may not allow duplicate key-value pairs. In such implementations, calling #pu 025 * </p> 026 * 027 * @param <K> the key type 028 * @param <V> the value type 029 */ 030public interface ListMultimap<K, V> extends Multimap<K, V> { 031 032 /** 033 * Get the collection of values that are associated with the supplied key. 034 * <p> 035 * Changes to the returned collection will update the values that this multimap associates with the key. 036 * </p> 037 * 038 * @param key the key 039 * @return the collection of values, or an empty collection if the supplied key was not associated with any values 040 */ 041 @Override 042 List<V> get( K key ); 043}