it.unimi.dsi.fastutil.longs
Class AbstractLongList.LongSubList

java.lang.Object
  extended by java.util.AbstractCollection<Long>
      extended by it.unimi.dsi.fastutil.longs.AbstractLongCollection
          extended by it.unimi.dsi.fastutil.longs.AbstractLongList
              extended by it.unimi.dsi.fastutil.longs.AbstractLongList.LongSubList
All Implemented Interfaces:
LongCollection, LongIterable, LongList, LongStack, Stack<Long>, Serializable, Comparable<List<? extends Long>>, Iterable<Long>, Collection<Long>, List<Long>
Enclosing class:
AbstractLongList

public static class AbstractLongList.LongSubList
extends AbstractLongList
implements Serializable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class it.unimi.dsi.fastutil.longs.AbstractLongList
AbstractLongList.LongSubList
 
Field Summary
static long serialVersionUID
           
 
Constructor Summary
AbstractLongList.LongSubList(LongList l, int from, int to)
           
 
Method Summary
 void add(int index, long k)
           
 boolean add(long k)
           
 boolean addAll(int index, Collection<? extends Long> c)
           
 boolean addAll(int index, LongCollection c)
          Delegates to a more generic method.
 boolean addAll(int index, LongList l)
          Delegates to a more generic method.
 void addElements(int index, long[] a, int offset, int length)
          Adds elements to this type-specific list one-by-one.
 void clear()
           
 void getElements(int from, long[] a, int offset, int length)
          Copies element of this type-specific list into the given array one-by-one.
 long getLong(int index)
           
 LongListIterator listIterator(int index)
          Returns a type-specific list iterator on the list starting at a given index.
 boolean rem(long 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.
 long removeLong(int index)
           
 long set(int index, long k)
           
 int size()
           
 LongList 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.longs.AbstractLongList
add, addAll, addAll, addAll, addElements, compareTo, contains, equals, get, hashCode, indexOf, indexOf, iterator, lastIndexOf, lastIndexOf, listIterator, longListIterator, longListIterator, longSubList, peek, peekLong, pop, popLong, push, push, remove, set, size, top, topLong, toString
 
Methods inherited from class it.unimi.dsi.fastutil.longs.AbstractLongCollection
add, contains, containsAll, containsAll, isEmpty, longIterator, rem, removeAll, removeAll, retainAll, retainAll, toArray, toArray, toArray, toLongArray, toLongArray
 
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.longs.LongCollection
containsAll, longIterator, removeAll, retainAll, toArray, toArray, toLongArray, toLongArray
 
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

AbstractLongList.LongSubList

public AbstractLongList.LongSubList(LongList l,
                                    int from,
                                    int to)
Method Detail

add

public boolean add(long k)
Specified by:
add in interface LongCollection
Specified by:
add in interface LongList
Overrides:
add in class AbstractLongList
See Also:
Collection.add(Object)

add

public void add(int index,
                long k)
Specified by:
add in interface LongList
Overrides:
add in class AbstractLongList
See Also:
List.add(int,Object)

addAll

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

getLong

public long getLong(int index)
Specified by:
getLong in interface LongList
See Also:
List.get(int)

removeLong

public long removeLong(int index)
Specified by:
removeLong in interface LongList
Overrides:
removeLong in class AbstractLongList
See Also:
List.remove(int)

set

public long set(int index,
                long k)
Specified by:
set in interface LongList
Overrides:
set in class AbstractLongList
See Also:
List.set(int,Object)

clear

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

size

public int size()
Specified by:
size in interface Collection<Long>
Specified by:
size in interface List<Long>
Specified by:
size in class AbstractCollection<Long>

getElements

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

addElements

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

Specified by:
listIterator in interface LongList
Specified by:
listIterator in interface List<Long>
Overrides:
listIterator in class AbstractLongList
See Also:
List.listIterator(int)

subList

public LongList subList(int from,
                        int to)
Description copied from interface: LongList
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 LongList
Specified by:
subList in interface List<Long>
Overrides:
subList in class AbstractLongList
See Also:
List.subList(int,int)

rem

public boolean rem(long k)
Description copied from interface: LongCollection
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 LongCollection
Overrides:
rem in class AbstractLongList
See Also:
Collection.remove(Object)

remove

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

Specified by:
remove in interface Collection<Long>
Specified by:
remove in interface List<Long>
Overrides:
remove in class AbstractLongList

addAll

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

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

addAll

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

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