@@ -0,0 +1,3034 @@
+package ru.matevosyan;%0A%0A/**%0A * DynamicLinkedList class.%0A * Created on 21.05.2017.%0A * @author Matevosyan Vardan%0A * @version 1.0%0A */%0A%0Apublic class DynamicLinkedList%3CE%3E implements IDynamicLinkedList%3CE%3E%7B%0A%0A    private Object%5B%5D container;%0A    private Node%3CE%3E last;%0A    private int size = 0;%0A    private Node%3CE%3E first;%0A%0A    /**%0A     * Constructor.%0A     */%0A%0A    public DynamicLinkedList() %7B%0A%0A    %7D%0A%0A    /**%0A     * Create to add value to an array.%0A     * @param value is value that type which you declare in generics.%0A     * @throws ArrayIndexOutOfBoundsException if index is bigger than actual.%0A     */%0A%0A    @Override%0A    public void add(E value) throws ArrayIndexOutOfBoundsException %7B%0A        linkLast(value);%0A    %7D%0A%0A%0A    /**%0A     * Create to get the value from an array.%0A     * @param index position value in an array.%0A     * @return value that type that was declare in generic diamonds.%0A     * @throws IllegalArgumentException if is not correct index size.%0A     * @throws ArrayIndexOutOfBoundsException if index is bigger than actual.%0A     */%0A%0A    @Override%0A    public E get(int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException %7B%0A        return node(index).item;%0A    %7D%0A%0A    private Node%3CE%3E node(int index) %7B%0A        Node%3CE%3E entryNode;%0A        if(index %3C (size %3E%3E 1)) %7B%0A            entryNode = first;%0A            for (int i = 0; i %3C index; i++) %7B%0A                entryNode = entryNode.next;%0A            %7D%0A        %7D else %7B%0A            entryNode = last;%0A            for (int i = size - 1; i %3E index; i--) %7B%0A                entryNode = entryNode.next;%0A            %7D%0A        %7D%0A        return entryNode;%0A    %7D%0A%0A    /**%0A     * Check array size and rise it when an array length is equal or bigger that default size.%0A     * Or if it is the last index that going to be hold by passing value.%0A     * @param elementValue is value.%0A     */%0A%0A    private void linkLast(E elementValue) %7B%0A        Node%3CE%3E lastNode = last;%0A        Node%3CE%3E newNode = new Node%3C%3E(lastNode, elementValue, null);%0A        last = newNode;%0A        if (!(lastNode == null)) %7B%0A            lastNode.next = newNode;%0A        %7D else %7B%0A            first = newNode;%0A        %7D%0A        size++;%0A    %7D%0A%0A%0A    private static class Node%3CE%3E %7B%0A        E item;%0A        Node%3CE%3E prev;%0A        Node%3CE%3E next;%0A%0A        Node(Node%3CE%3E prev, E element, Node%3CE%3E next) %7B%0A            this.prev = prev;%0A            this.item = element;%0A            this.next = next;%0A        %7D%0A    %7D%0A%0A//    /**%0A//     * Override iterator method from interface Iterable.%0A//     * @return an instance of Iterator type.%0A//     */%0A//%0A//    @Override%0A//    public Iterator%3CE%3E iterator() %7B%0A//%0A//        return new Iterator%3CE%3E() %7B%0A//%0A//            int count = 0;%0A//            @Override%0A//            public boolean hasNext() %7B%0A//                return count %3C container.length - (container.length - index);%0A//            %7D%0A//%0A//            @Override%0A//            @SuppressWarnings(%22unchecked%22)%0A//            public E next() %7B%0A//                return (E) container%5Bcount++%5D;%0A//            %7D%0A//        %7D;%0A//    %7D%0A%7D

add DynamicLinkedList.java