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

java.lang.Object
  extended byit.unimi.dsi.fastutil.longs.AbstractLongCollection
      extended byit.unimi.dsi.fastutil.longs.AbstractLongList
          extended byit.unimi.dsi.fastutil.longs.AbstractLongList.LongSubList
All Implemented Interfaces:
Collection, Comparable, List, LongCollection, LongList, LongStack, Serializable, Stack
Enclosing class:
AbstractLongList

public static class AbstractLongList.LongSubList
extends AbstractLongList
implements Serializable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class it.unimi.dsi.fastutil.longs.AbstractLongList
AbstractLongList.LongSubList
 
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 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 longListIterator(int index)
          Returns a type-specific list iterator on the list starting at a given index.
 LongList longSubList(int from, int to)
           
 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.
 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()
           
 
Methods inherited from class it.unimi.dsi.fastutil.longs.AbstractLongList
add, addAll, addAll, addAll, addElements, compareTo, contains, equals, get, hashCode, indexOf, indexOf, lastIndexOf, lastIndexOf, listIterator, listIterator, longIterator, longListIterator, peek, peekLong, pop, popLong, push, push, remove, set, size, subList, top, topLong, toString
 
Methods inherited from class it.unimi.dsi.fastutil.longs.AbstractLongCollection
add, contains, containsAll, containsAll, isEmpty, iterator, rem, remove, 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, iterator, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from interface it.unimi.dsi.fastutil.longs.LongCollection
containsAll, removeAll, retainAll, toArray, toLongArray, toLongArray
 
Methods inherited from interface it.unimi.dsi.fastutil.Stack
isEmpty
 

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
Overrides:
add in class AbstractLongList

add

public void add(int index,
                long k)
Specified by:
add in interface LongList
Overrides:
add in class AbstractLongList

addAll

public boolean addAll(int index,
                      Collection c)
Specified by:
addAll in interface List
Overrides:
addAll 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

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

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

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

set

public long set(int index,
                long k)
Specified by:
set in interface LongList
Overrides:
set in class AbstractLongList

clear

public void clear()
Specified by:
clear in interface List
Overrides:
clear in class AbstractLongCollection

size

public int size()
Specified by:
size in interface List

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.

longListIterator

public LongListIterator longListIterator(int index)
Description copied from interface: LongList
Returns a type-specific list iterator on the list starting at a given index.

The iterator returned by the List.listIterator() method and by this method are identical; however, using this method you can save a type casting.

Specified by:
longListIterator in interface LongList
Overrides:
longListIterator in class AbstractLongList

longSubList

public LongList longSubList(int from,
                            int to)
Specified by:
longSubList in interface LongList
Overrides:
longSubList in class AbstractLongList