📄 doublylinkedlist.java
字号:
// Decompiled by Jad v1.5.7f. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3)
// Source File Name: DoublyLinkedList.java
package matchit2;
// Referenced classes of package matchit2:
// ListItem
class DoublyLinkedList
{
DoublyLinkedList()
{
}
boolean isEmpty()
{
return head.next == null;
}
ListItem getFirst()
{
return head.next;
}
ListItem getNext(ListItem li)
{
if(li.next == null && li.prev == null)
throw new IllegalArgumentException("getNext from item not in list");
else
return li.next;
}
void remove(ListItem li)
{
li.remove();
}
void addFirst(ListItem li)
{
if(li.next != null || li.prev != null)
throw new IllegalArgumentException("addFirst item already in list");
li.next = head.next;
if(li.next != null)
li.next.prev = li;
li.prev = head;
head.next = li;
}
private final ListItem head = new ListItem();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -