Class AbstractObjectList.ObjectSubList<K>
- java.lang.Object
-
- java.util.AbstractCollection<K>
-
- org.codelibs.jhighlight.fastutil.objects.AbstractObjectCollection<K>
-
- org.codelibs.jhighlight.fastutil.objects.AbstractObjectList<K>
-
- org.codelibs.jhighlight.fastutil.objects.AbstractObjectList.ObjectSubList<K>
-
- All Implemented Interfaces:
Serializable,Comparable<List<? extends K>>,Iterable<K>,Collection<K>,List<K>,ObjectCollection<K>,ObjectIterable<K>,ObjectList<K>,Stack<K>
- Enclosing class:
- AbstractObjectList<K>
public static class AbstractObjectList.ObjectSubList<K> extends AbstractObjectList<K> implements Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.codelibs.jhighlight.fastutil.objects.AbstractObjectList
AbstractObjectList.ObjectSubList<K>
-
-
Field Summary
Fields Modifier and Type Field Description protected intfromInitial (inclusive) index of this sublist.protected ObjectList<K>lThe list this sublist restricts.protected inttoFinal (exclusive) index of this sublist.
-
Constructor Summary
Constructors Constructor Description ObjectSubList(ObjectList<K> l, int from, int to)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, K k)booleanadd(K k)booleanaddAll(int index, Collection<? extends K> c)voidaddElements(int index, K[] a, int offset, int length)Adds elements to this type-specific list one-by-one.voidclear()Kget(int index)voidgetElements(int from, Object[] a, int offset, int length)Copies element of this type-specific list into the given array one-by-one.ObjectListIterator<K>listIterator(int index)Returns a type-specific list iterator on the list starting at a given index.Kremove(int index)booleanremove(Object o)voidremoveElements(int from, int to)Removes elements of this type-specific list one-by-one.Kset(int index, K k)intsize()ObjectList<K>subList(int from, int to)Returns a type-specific view of the portion of this list from the indexfrom, inclusive, to the indexto, exclusive.-
Methods inherited from class org.codelibs.jhighlight.fastutil.objects.AbstractObjectList
addAll, addElements, compareTo, contains, ensureIndex, ensureRestrictedIndex, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, objectListIterator, objectListIterator, objectSubList, peek, pop, push, size, top, toString
-
Methods inherited from class org.codelibs.jhighlight.fastutil.objects.AbstractObjectCollection
containsAll, isEmpty, objectIterator, removeAll, retainAll, toArray, toArray
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
containsAll, isEmpty, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Methods inherited from interface org.codelibs.jhighlight.fastutil.objects.ObjectCollection
objectIterator, toArray
-
-
-
-
Field Detail
-
l
protected final ObjectList<K> l
The list this sublist restricts.
-
from
protected final int from
Initial (inclusive) index of this sublist.
-
to
protected int to
Final (exclusive) index of this sublist.
-
-
Constructor Detail
-
ObjectSubList
public ObjectSubList(ObjectList<K> l, int from, int to)
-
-
Method Detail
-
add
public boolean add(K k)
- Specified by:
addin interfaceCollection<K>- Specified by:
addin interfaceList<K>- Overrides:
addin classAbstractObjectList<K>
-
add
public void add(int index, K k)
-
addAll
public boolean addAll(int index, Collection<? extends K> c)
-
remove
public K remove(int index)
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<K>- Specified by:
clearin interfaceList<K>- Overrides:
clearin classAbstractCollection<K>
-
size
public int size()
- Specified by:
sizein interfaceCollection<K>- Specified by:
sizein interfaceList<K>- Specified by:
sizein classAbstractCollection<K>
-
getElements
public void getElements(int from, Object[] a, int offset, int length)Description copied from class:AbstractObjectListCopies element of this type-specific list into the given array one-by-one.This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
- Specified by:
getElementsin interfaceObjectList<K>- Overrides:
getElementsin classAbstractObjectList<K>- Parameters:
from- the start index (inclusive).a- the destination array.offset- the offset into the destination array where to store the first element copied.length- the number of elements to be copied.
-
removeElements
public void removeElements(int from, int to)Description copied from class:AbstractObjectListRemoves elements of this type-specific list one-by-one.This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
- Specified by:
removeElementsin interfaceObjectList<K>- Overrides:
removeElementsin classAbstractObjectList<K>- Parameters:
from- the start index (inclusive).to- the end index (exclusive).
-
addElements
public void addElements(int index, K[] a, int offset, int length)Description copied from class:AbstractObjectListAdds elements to this type-specific list one-by-one.This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
- Specified by:
addElementsin interfaceObjectList<K>- Overrides:
addElementsin classAbstractObjectList<K>- Parameters:
index- the index at which to add elements.a- the array containing the elements.offset- the offset of the first element to add.length- the number of elements to add.
-
listIterator
public ObjectListIterator<K> listIterator(int index)
Description copied from interface:ObjectListReturns a type-specific list iterator on the list starting at a given index.- Specified by:
listIteratorin interfaceList<K>- Specified by:
listIteratorin interfaceObjectList<K>- Overrides:
listIteratorin classAbstractObjectList<K>- See Also:
List.listIterator(int)
-
subList
public ObjectList<K> subList(int from, int to)
Description copied from interface:ObjectListReturns a type-specific view of the portion of this list from the indexfrom, inclusive, to the indexto, exclusive.Note that this specification strengthens the one given in
List.subList(int,int).- Specified by:
subListin interfaceList<K>- Specified by:
subListin interfaceObjectList<K>- Overrides:
subListin classAbstractObjectList<K>- See Also:
List.subList(int,int)
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceCollection<K>- Specified by:
removein interfaceList<K>- Overrides:
removein classAbstractCollection<K>
-
-