类 SelfSortList<E>
- java.lang.Object
-
- cc.shacocloud.mirage.utils.collection.SelfSortList<E>
-
- 类型参数:
E- 泛型实例
- 所有已实现的接口:
Iterable<E>,Collection<E>,List<E>
- 直接已知子类:
SelfSortSet
public class SelfSortList<E> extends Object implements List<E>
自排序集合,使用Comparable获取对面的排序值,基于ArrayList实现,所以是非线程安全对象,请注意使用如果需要线程安全可以配合
Collections.synchronizedList(List)使用
-
-
字段概要
字段 修饰符和类型 字段 说明 static intDEFAULT_CAPACITY默认初始容量
-
构造器概要
构造器 构造器 说明 SelfSortList(int initialCapacity, Comparable<E> comparable)SelfSortList(Comparable<E> comparable)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidadd(int index, E element)booleanadd(E e)booleanaddAll(int index, Collection<? extends E> c)booleanaddAll(Collection<? extends E> c)voidclear()booleancontains(Object o)booleancontainsAll(Collection<?> c)Eget(int index)intindexOf(Object o)booleanisEmpty()@NotNull Iterator<E>iterator()intlastIndexOf(Object o)ListIterator<E>listIterator()ListIterator<E>listIterator(int index)Eremove(int index)booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)Eset(int index, E element)intsize()voidsort(Comparator<? super E> c)List<E>subList(int fromIndex, int toIndex)Object[]toArray()<T> T[]toArray(T[] a)StringtoString()-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
从接口继承的方法 java.util.Collection
parallelStream, removeIf, stream, toArray
-
从接口继承的方法 java.util.List
equals, hashCode, replaceAll, spliterator
-
-
-
-
字段详细资料
-
DEFAULT_CAPACITY
public static final int DEFAULT_CAPACITY
默认初始容量- 另请参阅:
- 常量字段值
-
-
构造器详细资料
-
SelfSortList
public SelfSortList(Comparable<E> comparable)
- 参数:
comparable- 获取当前对象排序所用值的函数
-
SelfSortList
public SelfSortList(int initialCapacity, Comparable<E> comparable)- 参数:
initialCapacity- 初始长度comparable- 获取当前对象排序所用值的函数
-
-
方法详细资料
-
contains
public boolean contains(Object o)
-
containsAll
public boolean containsAll(Collection<?> c)
- 指定者:
containsAll在接口中Collection<E>- 指定者:
containsAll在接口中List<E>
-
lastIndexOf
public int lastIndexOf(Object o)
- 指定者:
lastIndexOf在接口中List<E>
-
listIterator
public ListIterator<E> listIterator()
- 指定者:
listIterator在接口中List<E>
-
listIterator
public ListIterator<E> listIterator(int index)
- 指定者:
listIterator在接口中List<E>
-
addAll
public boolean addAll(Collection<? extends E> c)
-
addAll
public boolean addAll(int index, Collection<? extends E> c)
-
removeAll
public boolean removeAll(Collection<?> c)
-
retainAll
public boolean retainAll(Collection<?> c)
-
sort
public void sort(Comparator<? super E> c)
-
-