@@ -0,0 +1,2305 @@
+package ru.agolovin;%0A%0Aimport java.util.Iterator;%0Aimport java.util.Map;%0A%0A/**%0A * @author agolovin (agolovin@list.ru)%0A * @version $Id$%0A * @since 0.1%0A */%0A%0Apublic class MyMap%3CT, V%3E implements Iterable%3CV%3E %7B%0A%0A    private Node%3CT, V%3E%5B%5D nodes;%0A    private int position = 0;%0A%0A    public MyMap() %7B%0A        int capacity = 16;%0A        this.nodes = new Node%5Bcapacity%5D;%0A    %7D%0A%0A    boolean insert(T key, V value) %7B%0A        return false;%0A    %7D%0A%0A    private boolean insertVal(int hash, T key, V value) %7B%0A        if (this.nodes.length == 0 %7C%7C this.nodes == null %7C%7C position %3E (this.nodes.length - 1)) %7B%0A            this.nodes = resize();%0A        %7D%0A        return false;%0A    %7D%0A%0A    final Node%3CT, V%3E%5B%5D resize() %7B%0A        int newCapacity = this.nodes.length * 2;%0A        Node%3CT, V%3E%5B%5D newTab = (Node%3CT, V%3E%5B%5D) new Node%5BnewCapacity%5D;%0A        for (int j = 0; j %3C this.nodes.length; ++j) %7B%0A            Node%3CT, V%3E e;%0A            if ((e = this.nodes%5Bj%5D) != null) %7B%0A                newTab%5BindexOfTable(e.hash, newCapacity)%5D = e;%0A            %7D%0A        %7D%0A        return newTab;%0A    %7D%0A%0A    private int indexOfTable(int hash, int length) %7B%0A        return (length - 1) & hash;%0A    %7D%0A%0A    V get(T key) %7B%0A        return null;%0A    %7D%0A%0A    boolean delete(T key) %7B%0A        return false;%0A    %7D%0A%0A%0A    private int hash(Object key) %7B%0A        int h = key.hashCode();%0A        return h %5E (h %3E%3E%3E 16);%0A    %7D%0A%0A    @Override%0A    public Iterator%3CV%3E iterator() %7B%0A        return new Iterator%3CV%3E() %7B%0A            @Override%0A            public boolean hasNext() %7B%0A                return false;%0A            %7D%0A%0A            @Override%0A            public V next() %7B%0A                return null;%0A            %7D%0A        %7D;%0A    %7D%0A%0A    private class Node%3CT, V%3E implements Map.Entry%3CT, V%3E %7B%0A%0A        Node%3CT, V%3E next;%0A        T key;%0A        V value;%0A        int hash;%0A%0A        public Node(int hash, T key, V value, Node%3CT, V%3E next) %7B%0A            this.next = next;%0A            this.key = key;%0A            this.value = value;%0A            this.hash = hash;%0A        %7D%0A%0A        @Override%0A        public T getKey() %7B%0A            return this.key;%0A        %7D%0A%0A        @Override%0A        public V setValue(V value) %7B%0A            this.value = value;%0A            return this.value;%0A        %7D%0A%0A        @Override%0A        public V getValue() %7B%0A            return this.value;%0A        %7D%0A    %7D%0A%7D%0A

add task8 in part5 chapter5 package2