it.unimi.dsi.fastutil.longs
Class AbstractLongBigList.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.AbstractLongBigList
              extended by it.unimi.dsi.fastutil.longs.AbstractLongBigList.LongSubList
All Implemented Interfaces:
BigList<Long>, LongBigList, LongCollection, LongIterable, LongStack, Size64, Stack<Long>, Serializable, Comparable<BigList<? extends Long>>, Iterable<Long>, Collection<Long>
Enclosing class:
AbstractLongBigList

public static class AbstractLongBigList.LongSubList
extends AbstractLongBigList
implements Serializable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class it.unimi.dsi.fastutil.longs.AbstractLongBigList
AbstractLongBigList.LongSubList
 
Field Summary
protected  long from
          Initial (inclusive) index of this sublist.
protected  LongBigList l
          The list this sublist restricts.
static long serialVersionUID
           
protected  long to
          Final (exclusive) index of this sublist.
 
Constructor Summary
AbstractLongBigList.LongSubList(LongBigList l, long from, long to)
           
 
Method Summary
 boolean add(long k)
           
 void add(long index, long k)
           
 boolean addAll(long index, Collection<? extends Long> c)
          Inserts all of the elements in the specified collection into this big list at the specified position (optional operation).
 boolean addAll(long index, LongCollection c)
          Delegates to a more generic method.
 boolean addAll(long index, LongList l)
           
 void addElements(long index, long[][] a, long offset, long length)
          Adds elements to this type-specific big list one-by-one.
 void clear()
           
 void getElements(long from, long[][] a, long offset, long length)
          Copies element of this type-specific big list into the given big array one-by-one.
 long getLong(long index)
           
 LongBigListIterator listIterator(long index)
          Returns a type-specific list iterator on this type-specific big 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 the type-specific rem() method.
 void removeElements(long from, long to)
          Removes elements of this type-specific big list one-by-one.
 long removeLong(long index)
           
 long set(long index, long k)
           
 long size64()
          Returns the size of this data structure as a long.
 LongBigList 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 class it.unimi.dsi.fastutil.longs.AbstractLongBigList
add, addAll, addAll, addAll, addAll, addAll, addElements, compareTo, contains, ensureIndex, ensureRestrictedIndex, equals, get, getLong, hashCode, indexOf, indexOf, iterator, lastIndexOf, lastIndexOf, listIterator, listIterator, peek, peekLong, pop, popLong, push, push, remove, remove, removeLong, set, set, size, size, 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
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.fastutil.longs.LongCollection
containsAll, longIterator, removeAll, retainAll, toArray, toArray, toLongArray, toLongArray
 
Methods inherited from interface java.util.Collection
add, contains, containsAll, isEmpty, removeAll, retainAll, toArray
 
Methods inherited from interface it.unimi.dsi.fastutil.Stack
isEmpty
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values

l

protected final LongBigList l
The list this sublist restricts.


from

protected final long from
Initial (inclusive) index of this sublist.


to

protected long to
Final (exclusive) index of this sublist.

Constructor Detail

AbstractLongBigList.LongSubList

public AbstractLongBigList.LongSubList(LongBigList l,
                                       long from,
                                       long to)
Method Detail

add

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

add

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

addAll

public boolean addAll(long index,
                      Collection<? extends Long> c)
Description copied from interface: BigList
Inserts all of the elements in the specified collection into this big list at the specified position (optional operation).

Specified by:
addAll in interface BigList<Long>
Overrides:
addAll in class AbstractLongBigList
Parameters:
index - index at which to insert the first element from the specified collection.
c - collection containing elements to be added to this big list.
Returns:
true if this big list changed as a result of the call
See Also:
List.addAll(int, Collection)

getLong

public long getLong(long index)
Specified by:
getLong in interface LongBigList
See Also:
BigList.get(long)

removeLong

public long removeLong(long index)
Specified by:
removeLong in interface LongBigList
Overrides:
removeLong in class AbstractLongBigList
See Also:
BigList.remove(long)

set

public long set(long index,
                long k)
Specified by:
set in interface LongBigList
Overrides:
set in class AbstractLongBigList
See Also:
BigList.set(long,Object)

clear

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

size64

public long size64()
Description copied from interface: Size64
Returns the size of this data structure as a long.

Specified by:
size64 in interface Size64
Returns:
the size of this data structure.

getElements

public void getElements(long from,
                        long[][] a,
                        long offset,
                        long length)
Description copied from class: AbstractLongBigList
Copies element of this type-specific big list into the given big 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 LongBigList
Overrides:
getElements in class AbstractLongBigList
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

public void removeElements(long from,
                           long to)
Description copied from class: AbstractLongBigList
Removes elements of this type-specific big 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 LongBigList
Overrides:
removeElements in class AbstractLongBigList
Parameters:
from - the start index (inclusive).
to - the end index (exclusive).

addElements

public void addElements(long index,
                        long[][] a,
                        long offset,
                        long length)
Description copied from class: AbstractLongBigList
Adds elements to this type-specific big 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 LongBigList
Overrides:
addElements in class AbstractLongBigList
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.

listIterator

public LongBigListIterator listIterator(long index)
Description copied from interface: LongBigList
Returns a type-specific list iterator on this type-specific big list starting at a given index.

Specified by:
listIterator in interface BigList<Long>
Specified by:
listIterator in interface LongBigList
Overrides:
listIterator in class AbstractLongBigList
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

public LongBigList subList(long from,
                           long to)
Description copied from interface: LongBigList
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<Long>
Specified by:
subList in interface LongBigList
Overrides:
subList in class AbstractLongBigList
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)

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 AbstractLongBigList
See Also:
Collection.remove(Object)

remove

public boolean remove(Object o)
Description copied from class: AbstractLongCollection
Delegates to the type-specific rem() method.

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

addAll

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

Specified by:
addAll in interface LongBigList
Overrides:
addAll in class AbstractLongBigList
See Also:
List.addAll(int,java.util.Collection)

addAll

public boolean addAll(long index,
                      LongList l)


Copyright © 2011. All Rights Reserved.