it.unimi.dsi.fastutil.shorts
Interface ShortBigList

All Superinterfaces:
BigList<Short>, Collection<Short>, Comparable<BigList<? extends Short>>, Iterable<Short>, ShortCollection, ShortIterable, Size64
All Known Implementing Classes:
AbstractShortBigList, AbstractShortBigList.ShortSubList, ShortBigArrayBigList, ShortBigLists.EmptyBigList, ShortBigLists.ListBigList, ShortBigLists.Singleton, ShortBigLists.SynchronizedBigList, ShortBigLists.UnmodifiableBigList

public interface ShortBigList
extends BigList<Short>, ShortCollection, Comparable<BigList<? extends Short>>

A type-specific BigList; provides some additional methods that use polymorphism to avoid (un)boxing.

Additionally, this interface strengthens iterator(), listIterator(), listIterator(long) and subList(long,long).

Besides polymorphic methods, this interfaces specifies methods to copy into an array or remove contiguous sublists. Although the abstract implementation of this interface provides simple, one-by-one implementations of these methods, it is expected that concrete implementation override them with optimized versions.

See Also:
List

Method Summary
 void add(long index, short key)
           
 boolean addAll(long index, ShortBigList c)
           
 boolean addAll(long index, ShortCollection c)
           
 boolean addAll(ShortBigList c)
           
 void addElements(long index, short[][] a)
          Add (hopefully quickly) elements to this type-specific big list.
 void addElements(long index, short[][] a, long offset, long length)
          Add (hopefully quickly) elements to this type-specific big list.
 void getElements(long from, short[][] a, long offset, long length)
          Copies (hopefully quickly) elements of this type-specific big list into the given big array.
 short getShort(long index)
           
 long indexOf(short k)
           
 ShortBigListIterator iterator()
          Returns a type-specific big-list iterator on this type-specific big list.
 long lastIndexOf(short k)
           
 ShortBigListIterator listIterator()
          Returns a type-specific big-list iterator on this type-specific big list.
 ShortBigListIterator listIterator(long index)
          Returns a type-specific list iterator on this type-specific big list starting at a given index.
 void removeElements(long from, long to)
          Removes (hopefully quickly) elements of this type-specific big list.
 short removeShort(long index)
           
 short set(long index, short k)
           
 ShortBigList subList(long from, long to)
          Returns a type-specific view of the portion of this type-specific big list from the index from, inclusive, to the index to, exclusive.
 
Methods inherited from interface it.unimi.dsi.fastutil.BigList
add, addAll, get, indexOf, lastIndexOf, remove, set, size
 
Methods inherited from interface it.unimi.dsi.fastutil.Size64
size, size64
 
Methods inherited from interface it.unimi.dsi.fastutil.shorts.ShortCollection
add, addAll, contains, containsAll, rem, removeAll, retainAll, shortIterator, toArray, toArray, toShortArray, toShortArray
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

iterator

ShortBigListIterator iterator()
Returns a type-specific big-list iterator on this type-specific big list.

Specified by:
iterator in interface Collection<Short>
Specified by:
iterator in interface Iterable<Short>
Specified by:
iterator in interface ShortCollection
Specified by:
iterator in interface ShortIterable
Returns:
a type-specific iterator on the elements of this collection.
See Also:
List.iterator()

listIterator

ShortBigListIterator listIterator()
Returns a type-specific big-list iterator on this type-specific big list.

Specified by:
listIterator in interface BigList<Short>
Returns:
a big-list iterator over the elements in this big list.
See Also:
List.listIterator()

listIterator

ShortBigListIterator listIterator(long index)
Returns a type-specific list iterator on this type-specific big list starting at a given index.

Specified by:
listIterator in interface BigList<Short>
Parameters:
index - index of first element to be returned from the big-list iterator.
Returns:
a big-list iterator of the elements in this big list, starting at the specified position in this big list.
See Also:
BigList.listIterator(long)

subList

ShortBigList subList(long from,
                     long to)
Returns a type-specific view of the portion of this type-specific big list from the index from, inclusive, to the index to, exclusive.

Note that this specification strengthens the one given in BigList.subList(long,long).

Specified by:
subList in interface BigList<Short>
Parameters:
from - the starting element (inclusive).
to - the ending element (exclusive).
Returns:
a big sublist view of this big list.
See Also:
BigList.subList(long,long)

getElements

void getElements(long from,
                 short[][] a,
                 long offset,
                 long length)
Copies (hopefully quickly) elements of this type-specific big list into the given big array.

Parameters:
from - the start index (inclusive).
a - the destination big array.
offset - the offset into the destination big array where to store the first element copied.
length - the number of elements to be copied.

removeElements

void removeElements(long from,
                    long to)
Removes (hopefully quickly) elements of this type-specific big list.

Parameters:
from - the start index (inclusive).
to - the end index (exclusive).

addElements

void addElements(long index,
                 short[][] a)
Add (hopefully quickly) elements to this type-specific big list.

Parameters:
index - the index at which to add elements.
a - the big array containing the elements.

addElements

void addElements(long index,
                 short[][] a,
                 long offset,
                 long length)
Add (hopefully quickly) elements to this type-specific big list.

Parameters:
index - the index at which to add elements.
a - the big array containing the elements.
offset - the offset of the first element to add.
length - the number of elements to add.

add

void add(long index,
         short key)
See Also:
List.add(int,Object)

addAll

boolean addAll(long index,
               ShortCollection c)
See Also:
List.addAll(int,java.util.Collection)

addAll

boolean addAll(long index,
               ShortBigList c)
See Also:
List.addAll(int,java.util.Collection)

addAll

boolean addAll(ShortBigList c)
See Also:
List.addAll(int,java.util.Collection)

getShort

short getShort(long index)
See Also:
BigList.get(long)

indexOf

long indexOf(short k)
See Also:
BigList.indexOf(Object)

lastIndexOf

long lastIndexOf(short k)
See Also:
BigList.lastIndexOf(Object)

removeShort

short removeShort(long index)
See Also:
BigList.remove(long)

set

short set(long index,
          short k)
See Also:
BigList.set(long,Object)


Copyright © 2011. All Rights Reserved.