|
|
|
|
@ -0,0 +1,54 @@
|
|
|
|
|
package 集合框架(LSP);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Map鎺ュ彛锛堥敭鍊煎<EFBFBD>闆嗗悎锛?
|
|
|
|
|
* @author 方初阳
|
|
|
|
|
* @version 1.0
|
|
|
|
|
* @created 23-10月-2025 21:37:33
|
|
|
|
|
*/
|
|
|
|
|
public interface Map<K, V> {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author 方初阳
|
|
|
|
|
* @version 1.0
|
|
|
|
|
* @created 23-10月-2025 21:37:33
|
|
|
|
|
*/
|
|
|
|
|
interface Entry<K, V> {
|
|
|
|
|
|
|
|
|
|
public K getKey();
|
|
|
|
|
|
|
|
|
|
public V getValue();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* @param value
|
|
|
|
|
*/
|
|
|
|
|
public V setValue(V value);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* @param key
|
|
|
|
|
*/
|
|
|
|
|
public V get(Object key);
|
|
|
|
|
|
|
|
|
|
public Set<K> keySet();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* @param key
|
|
|
|
|
* @param value
|
|
|
|
|
*/
|
|
|
|
|
public V put(K key, V value);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* @param key
|
|
|
|
|
*/
|
|
|
|
|
public V remove(Object key);
|
|
|
|
|
|
|
|
|
|
public Collection<V> values();
|
|
|
|
|
|
|
|
|
|
}
|