/** * Represents an item in a doubly linked deque. */ public class Item { /** * The value of the item. */ private T value; /** * The previous item in the deque. */ private Item prev; /** * The next item in the deque. */ private Item next; /** * Constructor for creating a new item. * * @param value The value of the item. */ public Item(T value) { this.value = value; this.prev = null; this.next = null; } /** * Returns the value of the item. * * @return The value of the item. */ public T getValue() { return value; } /** * Sets the value of the item. * * @param value The value of the item. */ public void setValue(T value) { this.value = value; } /** * Returns the previous item in the deque. * * @return The previous item in the deque. */ public Item getPrev() { return prev; } /** * Sets the previous item in the deque. * * @param prev The previous item in the deque. */ public void setPrev(Item prev) { this.prev = prev; } /** * Returns the next item in the deque. * * @return The next item in the deque. */ public Item getNext() { return next; } /** * Sets the next item in the deque. * * @param next The next item in the deque. */ public void setNext(Item next) { this.next = next; } }