public abstract class AbstractList<E> extends AbstractListAdaptor<E>
| 限定符和类型 | 字段和说明 |
|---|---|
protected com.github.houbb.data.struct.core.util.list.Node<E> |
head
头结点
|
protected int |
size
大小
|
protected com.github.houbb.data.struct.core.util.list.Node<E> |
tail
尾巴节点
作用:避免新增的时候,重复遍历。
|
| 构造器和说明 |
|---|
AbstractList() |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
add(E e)
添加元素
|
void |
add(int index,
E element) |
void |
clear() |
E |
get(int index) |
protected com.github.houbb.data.struct.core.util.list.Node<E> |
getIndexNode(int index)
从 head 开始循环遍历,获取对应的节点
|
int |
indexOf(Object o) |
boolean |
isEmpty() |
int |
lastIndexOf(Object o) |
protected void |
rangeCheck(int index)
范围校验
|
E |
remove(int index) |
boolean |
remove(Object o) |
E |
set(int index,
E element) |
int |
size() |
addAll, addAll, contains, containsAll, iterator, listIterator, listIterator, removeAll, retainAll, subList, toArray, toArrayclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequals, hashCode, replaceAll, sort, spliteratorparallelStream, removeIf, streamprotected int size
protected com.github.houbb.data.struct.core.util.list.Node<E> head
protected com.github.houbb.data.struct.core.util.list.Node<E> tail
public boolean add(E e)
add 在接口中 Collection<E>add 在接口中 List<E>add 在类中 AbstractListAdaptor<E>e - 元素public boolean remove(Object o)
remove 在接口中 Collection<E>remove 在接口中 List<E>remove 在类中 AbstractListAdaptor<E>public int indexOf(Object o)
public int lastIndexOf(Object o)
lastIndexOf 在接口中 List<E>lastIndexOf 在类中 AbstractListAdaptor<E>public int size()
size 在接口中 Collection<E>size 在接口中 List<E>size 在类中 AbstractListAdaptor<E>public boolean isEmpty()
isEmpty 在接口中 Collection<E>isEmpty 在接口中 List<E>isEmpty 在类中 AbstractListAdaptor<E>public void clear()
clear 在接口中 Collection<E>clear 在接口中 List<E>clear 在类中 AbstractListAdaptor<E>protected com.github.houbb.data.struct.core.util.list.Node<E> getIndexNode(int index)
index - 下标protected void rangeCheck(int index)
index - 索引Copyright © 2020. All rights reserved.