Skip to content

Commit

Permalink
Restore Deque Interface in DoublyLinkedList (#1169)
Browse files Browse the repository at this point in the history
* Restore deque interface

This reverts commit b627ca6 (#1159).

* Implement DoublyLinkedList.reversed()

Ref: #1154

* Move anonymous inner class to ReversedDoublyLinkedList class

* Block inverts in the reversed view

* Make iterators from reversed view unmodifiable

* Block node modification operations

* Add basic tests for reversed view

* Make iterator impl work with reversed view

* Remove redundant override

* Add more iterator tests

* Avoid using size variable for iterator creation

* Fix incorrect test design

* Make Surefire happier with test discovery

* Add common ancestor for list nodes

* Update Javadoc

* Document exceptions for list nodes

* Reorder methods in AbstractListNode

* Move node value to the AbstractListNode

* Hide internal methods in implementation

* Minimize amount of casting involved with ListNode

* Make ListNode an abstract class

* Adjust setter method visibilities of list nodes

* Test that DoublyLinkedList implements both List and Deque

Ref: #1169 (review)
  • Loading branch information
syoon2 committed Mar 21, 2024
1 parent 20e5f16 commit 227148a
Show file tree
Hide file tree
Showing 2 changed files with 929 additions and 116 deletions.

0 comments on commit 227148a

Please sign in to comment.