it.unimi.dsi.fastutil.shorts
Class AbstractShortList.ShortSubList

java.lang.Object
  extended by it.unimi.dsi.fastutil.shorts.AbstractShortCollection
      extended by it.unimi.dsi.fastutil.shorts.AbstractShortList
          extended by it.unimi.dsi.fastutil.shorts.AbstractShortList.ShortSubList
All Implemented Interfaces:
ShortCollection, ShortIterable, ShortList, ShortStack, Stack<Short>, Serializable, Comparable<List<? extends Short>>, Iterable<Short>, Collection<Short>, List<Short>
Enclosing class:
AbstractShortList

public static class AbstractShortList.ShortSubList
extends AbstractShortList
implements Serializable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class it.unimi.dsi.fastutil.shorts.AbstractShortList
AbstractShortList.ShortSubList
 
Field Summary
static long serialVersionUID
           
 
Constructor Summary
AbstractShortList.ShortSubList(ShortList l, int from, int to)
           
 
Method Summary
 void add(int index, short k)
           
 boolean add(short k)
           
 boolean addAll(int index, Collection<? extends Short> c)
           
 boolean addAll(int index, ShortCollection c)
          Delegates to a more generic method.
 boolean addAll(int index, ShortList l)
          Delegates to a more generic method.
 void addElements(int index, short[] a, int offset, int length)
          Adds elements to this type-specific list one-by-one.
 void clear()
           
 void getElements(int from, short[] a, int offset, int length)
          Copies element of this type-specific list into the given array one-by-one.
 short getShort(int index)
           
 ShortListIterator listIterator(int index)
          Returns a type-specific list iterator on the list starting at a given index.
 boolean rem(short k)
          Note that this method should be called remove(), but the clash with the similarly named index-based method in the List interface forces us to use a distinguished name.
 boolean remove(Object o)
          Delegates to rem().
 void removeElements(int from, int to)
          Removes elements of this type-specific list one-by-one.
 short removeShort(int index)
           
 short set(int index, short k)
           
 int size()
           
 ShortList subList(int from, int to)
          Returns a type-specific view of the portion of this list from the index from, inclusive, to the index to, exclusive.
 
Methods inherited from class it.unimi.dsi.fastutil.shorts.AbstractShortList
add, addAll, addAll, addAll, addElements, compareTo, contains, equals, get, hashCode, indexOf, indexOf, iterator, lastIndexOf, lastIndexOf, listIterator, peek, peekShort, pop, popShort, push, push, remove, set, shortListIterator, shortListIterator, shortSubList, size, top, topShort, toString
 
Methods inherited from class it.unimi.dsi.fastutil.shorts.AbstractShortCollection
add, contains, containsAll, containsAll, isEmpty, rem, removeAll, removeAll, retainAll, retainAll, shortIterator, toArray, toArray, toArray, toShortArray, toShortArray
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, contains, containsAll, isEmpty, removeAll, retainAll, toArray, toArray
 
Methods inherited from interface it.unimi.dsi.fastutil.shorts.ShortCollection
containsAll, removeAll, retainAll, shortIterator, toArray, toArray, toShortArray, toShortArray
 
Methods inherited from interface it.unimi.dsi.fastutil.Stack
isEmpty
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

AbstractShortList.ShortSubList

public AbstractShortList.ShortSubList(ShortList l,
                                      int from,
                                      int to)
Method Detail

add

public boolean add(short k)
Specified by:
add in interface ShortCollection
Overrides:
add in class AbstractShortList
See Also:
Collection.add(Object)

add

public void add(int index,
                short k)
Specified by:
add in interface ShortList
Overrides:
add in class AbstractShortList
See Also:
List.add(int,Object)

addAll

public boolean addAll(int index,
                      Collection<? extends Short> c)
Specified by:
addAll in interface List<Short>
Overrides:
addAll in class AbstractShortList

getShort

public short getShort(int index)
Specified by:
getShort in interface ShortList
See Also:
List.get(int)

removeShort

public short removeShort(int index)
Specified by:
removeShort in interface ShortList
Overrides:
removeShort in class AbstractShortList
See Also:
List.remove(int)

set

public short set(int index,
                 short k)
Specified by:
set in interface ShortList
Overrides:
set in class AbstractShortList
See Also:
List.set(int,Object)

clear

public void clear()
Specified by:
clear in interface Collection<Short>
Specified by:
clear in interface List<Short>
Overrides:
clear in class AbstractShortCollection

size

public int size()
Specified by:
size in interface Collection<Short>
Specified by:
size in interface List<Short>

getElements

public void getElements(int from,
                        short[] a,
                        int offset,
                        int length)
Description copied from class: AbstractShortList
Copies 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:
getElements in interface ShortList
Overrides:
getElements in class AbstractShortList
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: AbstractShortList
Removes 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:
removeElements in interface ShortList
Overrides:
removeElements in class AbstractShortList
Parameters:
from - the start index (inclusive).
to - the end index (exclusive).

addElements

public void addElements(int index,
                        short[] a,
                        int offset,
                        int length)
Description copied from class: AbstractShortList
Adds 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:
addElements in interface ShortList
Overrides:
addElements in class AbstractShortList
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 ShortListIterator listIterator(int index)
Description copied from interface: ShortList
Returns a type-specific list iterator on the list starting at a given index.

Specified by:
listIterator in interface ShortList
Specified by:
listIterator in interface List<Short>
Overrides:
listIterator in class AbstractShortList
See Also:
ShortList.listIterator(int)

subList

public ShortList subList(int from,
                         int to)
Description copied from interface: ShortList
Returns a type-specific view of the portion of this list from the index from, inclusive, to the index to, exclusive.

Note that this specification strengthens the one given in List.subList(int,int).

Specified by:
subList in interface ShortList
Specified by:
subList in interface List<Short>
Overrides:
subList in class AbstractShortList
See Also:
List.subList(int,int)

rem

public boolean rem(short k)
Description copied from interface: ShortCollection
Note that this method should be called remove(), but the clash with the similarly named index-based method in the List interface forces us to use a distinguished name. For simplicity, the set interfaces reinstates remove().

Specified by:
rem in interface ShortCollection
Overrides:
rem in class AbstractShortList
See Also:
Collection.remove(Object)

remove

public boolean remove(Object o)
Description copied from class: AbstractShortList
Delegates to rem().

Specified by:
remove in interface Collection<Short>
Specified by:
remove in interface List<Short>
Overrides:
remove in class AbstractShortList

addAll

public boolean addAll(int index,
                      ShortCollection c)
Description copied from class: AbstractShortList
Delegates to a more generic method.

Specified by:
addAll in interface ShortList
Overrides:
addAll in class AbstractShortList
See Also:
List.add(int,Object)

addAll

public boolean addAll(int index,
                      ShortList l)
Description copied from class: AbstractShortList
Delegates to a more generic method.

Specified by:
addAll in interface ShortList
Overrides:
addAll in class AbstractShortList
See Also:
List.add(int,Object)