it.unimi.dsi.bits
Class AbstractBitVector.LongBigListView

java.lang.Object
  extended by it.unimi.dsi.fastutil.longs.AbstractLongCollection
      extended by it.unimi.dsi.fastutil.longs.AbstractLongList
          extended by it.unimi.dsi.bits.AbstractBitVector.LongBigListView
All Implemented Interfaces:
LongCollection, LongIterable, LongList, LongStack, Stack<Long>, LongBigList, Serializable, Comparable<List<? extends Long>>, Iterable<Long>, Collection<Long>, List<Long>
Direct Known Subclasses:
LongArrayBitVector.LongBigListView
Enclosing class:
AbstractBitVector

public static class AbstractBitVector.LongBigListView
extends AbstractLongList
implements LongBigList, Serializable

A list-of-integers view of a bit vector.

This class implements in the obvious way a view of a bit vector as a list of integers of given width. The vector is enlarged as needed (i.e., when adding new elements), but it is never shrunk.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class it.unimi.dsi.fastutil.longs.AbstractLongList
AbstractLongList.LongSubList
 
Field Summary
protected  BitVector bitVector
          The underlying bit vector.
protected  long fullMask
          A bit mask containing width bits set to one.
protected  int width
          The width in bit of an element of this list view.
 
Constructor Summary
AbstractBitVector.LongBigListView(BitVector bitVector, int width)
           
 
Method Summary
 void add(int index, long value)
           
 void add(long index, long value)
          Adds the long at the given position.
 long getLong(int index)
           
 long getLong(long index)
          Returns the long at the given position.
 long length()
          The number of elements in this big list.
 LongBigList length(long newSize)
          Sets the number of elements in this big list.
 LongListIterator listIterator()
           
 long removeLong(long index)
          Removes the long at the given position.
 long set(int index, long value)
           
 long set(long index, long value)
          Sets the long at the given position.
 int size()
           
 void size(int newSize)
           
 LongBigList subList(long from, long to)
          Returns a big sublist view of this big list.
 
Methods inherited from class it.unimi.dsi.fastutil.longs.AbstractLongList
add, add, addAll, addAll, addAll, addAll, addAll, addAll, addElements, addElements, compareTo, contains, ensureIndex, ensureRestrictedIndex, equals, get, getElements, hashCode, indexOf, indexOf, iterator, lastIndexOf, lastIndexOf, listIterator, longListIterator, longListIterator, longSubList, peek, peekLong, pop, popLong, push, push, rem, remove, remove, removeElements, removeLong, set, subList, top, topLong, toString
 
Methods inherited from class it.unimi.dsi.fastutil.longs.AbstractLongCollection
add, clear, 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.LongList
addAll, addAll, addAll, addElements, addElements, getElements, indexOf, iterator, lastIndexOf, listIterator, longListIterator, longListIterator, longSubList, removeElements, removeLong, subList
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, lastIndexOf, remove, remove, removeAll, retainAll, set, toArray, toArray
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface it.unimi.dsi.fastutil.longs.LongCollection
add, addAll, contains, containsAll, longIterator, rem, removeAll, retainAll, toArray, toArray, toLongArray, toLongArray
 
Methods inherited from interface it.unimi.dsi.fastutil.Stack
isEmpty
 

Field Detail

bitVector

protected final BitVector bitVector
The underlying bit vector.


width

protected final int width
The width in bit of an element of this list view.


fullMask

protected final long fullMask
A bit mask containing width bits set to one.

Constructor Detail

AbstractBitVector.LongBigListView

public AbstractBitVector.LongBigListView(BitVector bitVector,
                                         int width)
Method Detail

length

public long length()
Description copied from interface: LongBigList
The number of elements in this big list.

Specified by:
length in interface LongBigList
Returns:
the number of elements in this big list.
See Also:
List.size()

size

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

length

public LongBigList length(long newSize)
Description copied from interface: LongBigList
Sets the number of elements in this big list.

Specified by:
length in interface LongBigList
Returns:
this big list.
See Also:
LongList.size(int)

size

public void size(int newSize)
Specified by:
size in interface LongList
Overrides:
size in class AbstractLongList

listIterator

public LongListIterator listIterator()
Specified by:
listIterator in interface LongList
Specified by:
listIterator in interface List<Long>
Overrides:
listIterator in class AbstractLongList

add

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

add

public void add(long index,
                long value)
Description copied from interface: LongBigList
Adds the long at the given position.

Specified by:
add in interface LongBigList
Parameters:
index - a position in the list.
value - a long value.
See Also:
List.add(int,Object)

getLong

public long getLong(long index)
Description copied from interface: LongBigList
Returns the long at the given position.

Specified by:
getLong in interface LongBigList
Parameters:
index - a position in the list.
Returns:
the corresponding long value.
See Also:
List.get(int)

getLong

public long getLong(int index)
Specified by:
getLong in interface LongList

removeLong

public long removeLong(long index)
Description copied from interface: LongBigList
Removes the long at the given position.

Specified by:
removeLong in interface LongBigList
Parameters:
index - a position in the list.
Returns:
the long previously at the specified position.
See Also:
List.remove(int)

set

public long set(long index,
                long value)
Description copied from interface: LongBigList
Sets the long at the given position.

Specified by:
set in interface LongBigList
Parameters:
index - a position in the list.
value - a long value.
Returns:
the previous value.
See Also:
List.set(int,Object)

set

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

subList

public LongBigList subList(long from,
                           long to)
Description copied from interface: LongBigList
Returns a big sublist view of this big list.

Specified by:
subList in interface LongBigList
Parameters:
from - the starting element (inclusive).
to - the ending element (exclusive).
Returns:
a big sublist view of this big list.
See Also:
List.subList(int, int)