import java.util.Collection; import java.util.HashSet; import java.util.LinkedList; import java.util.Map; import java.util.Set; public class Hachage implements Map { LinkedList> list; public Hachage() { list = new LinkedList<>(); } @Override public void clear() { list.clear(); } @Override public boolean containsKey(Object key) { // TODO Auto-generated method stub return false; } @Override public boolean containsValue(Object value) { // TODO Auto-generated method stub return false; } @Override public Set> entrySet() { // TODO Auto-generated method stub return null; } @Override public V get(Object key) { for (Map.Entry entry : list) { if (key.equals(entry.getKey())) { return entry.getValue(); } } return null; } @Override public boolean isEmpty() { // TODO Auto-generated method stub return false; } @Override public Set keySet() { Set set = new HashSet<>(list.size()); for (Entry entry : list) { set.add(entry.getKey()); } return set; } @Override public V put(K key, V value) { for (Map.Entry entry : list) { if (key.equals(entry.getKey())) { V oldValue = entry.getValue(); entry.setValue(value); return oldValue; } } list.add(new Entree(key ,value)); return null; } @Override public void putAll(Map m) { // TODO Auto-generated method stub } @Override public V remove(Object key) { // TODO Auto-generated method stub return null; } @Override public int size() { return list.size(); } @Override public Collection values() { // TODO Auto-generated method stub return null; } }