it.unimi.dsi.fastutil.bytes
Class ByteBigLists.EmptyBigList

java.lang.Object
  extended by java.util.AbstractCollection<Byte>
      extended by it.unimi.dsi.fastutil.bytes.AbstractByteCollection
          extended by it.unimi.dsi.fastutil.bytes.ByteCollections.EmptyCollection
              extended by it.unimi.dsi.fastutil.bytes.ByteBigLists.EmptyBigList
All Implemented Interfaces:
BigList<Byte>, ByteBigList, ByteCollection, ByteIterable, Size64, Serializable, Cloneable, Comparable<BigList<? extends Byte>>, Iterable<Byte>, Collection<Byte>
Enclosing class:
ByteBigLists

public static class ByteBigLists.EmptyBigList
extends ByteCollections.EmptyCollection
implements ByteBigList, Serializable, Cloneable

An immutable class representing an empty type-specific big list.

This class may be useful to implement your own in case you subclass a type-specific list.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
           
 
Constructor Summary
protected ByteBigLists.EmptyBigList()
           
 
Method Summary
 boolean add(byte k)
           
 boolean add(Byte k)
          Delegates to the corresponding type-specific method.
 void add(long index, byte k)
           
 void add(long index, Byte k)
          Inserts the specified element at the specified position in this big list (optional operation).
 boolean addAll(ByteBigList c)
           
 boolean addAll(ByteCollection c)
          Adds all elements of the given type-specific collection to this collection.
 boolean addAll(Collection<? extends Byte> c)
          Adds all elements of the given collection to this collection.
 boolean addAll(long i, ByteBigList c)
           
 boolean addAll(long i, ByteCollection c)
           
 boolean addAll(long i, Collection<? extends Byte> c)
          Inserts all of the elements in the specified collection into this big list at the specified position (optional operation).
 void addElements(long index, byte[][] a)
          Add (hopefully quickly) elements to this type-specific big list.
 void addElements(long index, byte[][] a, long offset, long length)
          Add (hopefully quickly) elements to this type-specific big list.
 Object clone()
           
 int compareTo(BigList<? extends Byte> o)
           
 Byte get(long i)
          Returns the element at the specified position.
 byte getByte(long i)
           
 void getElements(long from, byte[][] a, long offset, long length)
          Copies (hopefully quickly) elements of this type-specific big list into the given big array.
 long indexOf(byte k)
           
 long indexOf(Object k)
          Returns the index of the first occurrence of the specified element in this big list, or -1 if this big list does not contain the element.
 ByteBigListIterator iterator()
          Returns a type-specific iterator on the elements of this collection.
 long lastIndexOf(byte k)
           
 long lastIndexOf(Object k)
          Returns the index of the last occurrence of the specified element in this big list, or -1 if this big list does not contain the element.
 ByteBigListIterator listIterator()
          Returns a type-specific big-list iterator on this type-specific big list.
 ByteBigListIterator listIterator(long i)
          Returns a type-specific list iterator on this type-specific big list starting at a given index.
 Byte remove(long k)
          Removes the element at the specified position.
 boolean removeAll(Collection<?> c)
          Remove from this collection all elements in the given collection.
 byte removeByte(long i)
           
 void removeElements(long from, long to)
          Removes (hopefully quickly) elements of this type-specific big list.
 byte set(long index, byte k)
           
 Byte set(long index, Byte k)
          Replaces the element at the specified position in this big list with the specified element (optional operation).
 void size(long s)
          Sets the size of this big list.
 long size64()
          Returns the size of this data structure as a long.
 ByteBigList 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.bytes.ByteCollections.EmptyCollection
clear, contains, containsAll, equals, hashCode, rem, removeAll, retainAll, size, toArray, toByteArray, toByteArray
 
Methods inherited from class it.unimi.dsi.fastutil.bytes.AbstractByteCollection
byteIterator, contains, containsAll, isEmpty, rem, remove, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.fastutil.Size64
size
 
Methods inherited from interface it.unimi.dsi.fastutil.bytes.ByteCollection
byteIterator, contains, containsAll, rem, removeAll, retainAll, toArray, toArray, toByteArray, toByteArray
 
Methods inherited from interface java.util.Collection
clear, contains, containsAll, equals, hashCode, isEmpty, remove, retainAll, size, toArray
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

ByteBigLists.EmptyBigList

protected ByteBigLists.EmptyBigList()
Method Detail

add

public void add(long index,
                byte k)
Specified by:
add in interface ByteBigList
See Also:
List.add(int,Object)

add

public boolean add(byte k)
Specified by:
add in interface ByteCollection
Overrides:
add in class ByteCollections.EmptyCollection
See Also:
Collection.add(Object)

removeByte

public byte removeByte(long i)
Specified by:
removeByte in interface ByteBigList
See Also:
BigList.remove(long)

set

public byte set(long index,
                byte k)
Specified by:
set in interface ByteBigList
See Also:
BigList.set(long,Object)

indexOf

public long indexOf(byte k)
Specified by:
indexOf in interface ByteBigList
See Also:
BigList.indexOf(Object)

lastIndexOf

public long lastIndexOf(byte k)
Specified by:
lastIndexOf in interface ByteBigList
See Also:
BigList.lastIndexOf(Object)

addAll

public boolean addAll(Collection<? extends Byte> c)
Description copied from class: AbstractByteCollection
Adds all elements of the given collection to this collection.

Specified by:
addAll in interface Collection<Byte>
Overrides:
addAll in class AbstractByteCollection
Parameters:
c - a collection.
Returns:
true if this collection changed as a result of the call.

addAll

public boolean addAll(long i,
                      Collection<? extends Byte> 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<Byte>
Parameters:
i - 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)

removeAll

public boolean removeAll(Collection<?> c)
Description copied from class: AbstractByteCollection
Remove from this collection all elements in the given collection. If the collection is an instance of this class, it uses faster iterators.

Specified by:
removeAll in interface Collection<Byte>
Overrides:
removeAll in class AbstractByteCollection
Parameters:
c - a collection.
Returns:
true if this collection changed as a result of the call.

get

public Byte get(long i)
Description copied from interface: BigList
Returns the element at the specified position.

Specified by:
get in interface BigList<Byte>
Parameters:
i - a position in the big list.
Returns:
the element at the specified position.
See Also:
List.get(int)

addAll

public boolean addAll(ByteCollection c)
Description copied from class: AbstractByteCollection
Adds all elements of the given type-specific collection to this collection.

Specified by:
addAll in interface ByteCollection
Overrides:
addAll in class ByteCollections.EmptyCollection
Parameters:
c - a type-specific collection.
Returns:
true if this collection changed as a result of the call.
See Also:
Collection.addAll(Collection)

addAll

public boolean addAll(ByteBigList c)
Specified by:
addAll in interface ByteBigList
See Also:
List.addAll(int,java.util.Collection)

addAll

public boolean addAll(long i,
                      ByteCollection c)
Specified by:
addAll in interface ByteBigList
See Also:
List.addAll(int,java.util.Collection)

addAll

public boolean addAll(long i,
                      ByteBigList c)
Specified by:
addAll in interface ByteBigList
See Also:
List.addAll(int,java.util.Collection)

add

public void add(long index,
                Byte k)
Description copied from interface: BigList
Inserts the specified element at the specified position in this big list (optional operation).

Specified by:
add in interface BigList<Byte>
Parameters:
index - a position in the big list.
k - an element to be inserted.
See Also:
List.add(int,Object)

add

public boolean add(Byte k)
Description copied from class: AbstractByteCollection
Delegates to the corresponding type-specific method.

Specified by:
add in interface Collection<Byte>
Overrides:
add in class AbstractByteCollection

set

public Byte set(long index,
                Byte k)
Description copied from interface: BigList
Replaces the element at the specified position in this big list with the specified element (optional operation).

Specified by:
set in interface BigList<Byte>
Parameters:
index - a position in the big list.
k - the element to be stored at the specified position.
Returns:
the element previously at the specified positions.
See Also:
List.set(int,Object)

getByte

public byte getByte(long i)
Specified by:
getByte in interface ByteBigList
See Also:
BigList.get(long)

remove

public Byte remove(long k)
Description copied from interface: BigList
Removes the element at the specified position.

Specified by:
remove in interface BigList<Byte>
Parameters:
k - a position in the big list.
Returns:
the element previously at the specified position.
See Also:
List.remove(int)

indexOf

public long indexOf(Object k)
Description copied from interface: BigList
Returns the index of the first occurrence of the specified element in this big list, or -1 if this big list does not contain the element.

Specified by:
indexOf in interface BigList<Byte>
Parameters:
k - the object to search for.
Returns:
the index of the first occurrence of the specified element in this big list, or -1 if this big list does not contain the element.
See Also:
List.indexOf(Object)

lastIndexOf

public long lastIndexOf(Object k)
Description copied from interface: BigList
Returns the index of the last occurrence of the specified element in this big list, or -1 if this big list does not contain the element.

Specified by:
lastIndexOf in interface BigList<Byte>
Parameters:
k - the object to search for.
Returns:
the index of the last occurrence of the specified element in this big list, or -1 if this big list does not contain the element.
See Also:
List.lastIndexOf(Object)

listIterator

public ByteBigListIterator listIterator()
Description copied from interface: ByteBigList
Returns a type-specific big-list iterator on this type-specific big list.

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

iterator

public ByteBigListIterator iterator()
Description copied from interface: ByteCollection
Returns a type-specific iterator on the elements of this collection.

Note that this specification strengthens the one given in Iterable.iterator(), which was already strengthened in the corresponding type-specific class, but was weakened by the fact that this interface extends Collection.

Specified by:
iterator in interface ByteBigList
Specified by:
iterator in interface ByteCollection
Specified by:
iterator in interface ByteIterable
Specified by:
iterator in interface Iterable<Byte>
Specified by:
iterator in interface Collection<Byte>
Overrides:
iterator in class ByteCollections.EmptyCollection
Returns:
a type-specific iterator on the elements of this collection.
See Also:
List.iterator()

listIterator

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

Specified by:
listIterator in interface BigList<Byte>
Specified by:
listIterator in interface ByteBigList
Parameters:
i - 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 ByteBigList subList(long from,
                           long to)
Description copied from interface: ByteBigList
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<Byte>
Specified by:
subList in interface ByteBigList
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

public void getElements(long from,
                        byte[][] a,
                        long offset,
                        long length)
Description copied from interface: ByteBigList
Copies (hopefully quickly) elements of this type-specific big list into the given big array.

Specified by:
getElements in interface ByteBigList
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 interface: ByteBigList
Removes (hopefully quickly) elements of this type-specific big list.

Specified by:
removeElements in interface ByteBigList
Parameters:
from - the start index (inclusive).
to - the end index (exclusive).

addElements

public void addElements(long index,
                        byte[][] a,
                        long offset,
                        long length)
Description copied from interface: ByteBigList
Add (hopefully quickly) elements to this type-specific big list.

Specified by:
addElements in interface ByteBigList
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.

addElements

public void addElements(long index,
                        byte[][] a)
Description copied from interface: ByteBigList
Add (hopefully quickly) elements to this type-specific big list.

Specified by:
addElements in interface ByteBigList
Parameters:
index - the index at which to add elements.
a - the big array containing the elements.

size

public void size(long s)
Description copied from interface: BigList
Sets the size of this big list.

If the specified size is smaller than the current size, the last elements are discarded. Otherwise, they are filled with 0/null/false.

Specified by:
size in interface BigList<Byte>
Parameters:
s - the new size.

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.

compareTo

public int compareTo(BigList<? extends Byte> o)
Specified by:
compareTo in interface Comparable<BigList<? extends Byte>>

clone

public Object clone()
Overrides:
clone in class Object


Copyright © 2011. All Rights Reserved.