chapter_004/src/main/java/ru/job4j/list/MyLinkedList.java
/**
     * This method remove object from MyLinkedList.
     *
     * @param index - index.
     */
This method remove object from MyLinkedList.
@param index - index.
This method remove object from MyLinkedList . @param index - index .
public synchronized void remove(int index) {
        Node<E> result = findNode(index);
        if (result.getNext() == null && result.getPerv() != null) {
            result.getPerv().setNext(null);
            this.tail = result.getPerv();
        } else if (result.getPerv() == null && result.getNext() != null) {
            this.head = result.getNext();
            result.getNext().setPerv(null);
        } else if (result.getPerv() == null && result.getNext() == null) {
            this.head = null;
            this.tail = null;
        } else {
            result.getPerv().setNext(result.getNext());
        }
        size--;
    }
public synchronized void remove ( int index ) { Node < E > result = findNode ( index ) ; if ( result . getNext ( ) == null && result . getPerv ( ) != null ) { result . getPerv ( ) . setNext ( null ) ; this . tail = result . getPerv ( ) ; } else if ( result . getPerv ( ) == null && result . getNext ( ) != null ) { this . head = result . getNext ( ) ; result . getNext ( ) . setPerv ( null ) ; } else if ( result . getPerv ( ) == null && result . getNext ( ) == null ) { this . head = null ; this . tail = null ; } else { result . getPerv ( ) . setNext ( result . getNext ( ) ) ; } size -- ; }
This method remove object from MyLinkedList.
This method remove object from MyLinkedList .