it.unimi.dsi.fastutil.longs
Class LongLists.EmptyList

java.lang.Object
  extended by it.unimi.dsi.fastutil.longs.AbstractLongCollection
      extended by it.unimi.dsi.fastutil.longs.LongCollections.EmptyCollection
          extended by it.unimi.dsi.fastutil.longs.LongLists.EmptyList
All Implemented Interfaces:
LongCollection, LongIterable, LongList, Serializable, Cloneable, Comparable<List<? extends Long>>, Iterable<Long>, Collection<Long>, List<Long>
Enclosing class:
LongLists

public static class LongLists.EmptyList
extends LongCollections.EmptyCollection
implements LongList, Serializable, Cloneable

An immutable class representing an empty type-specific 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
           
 
Method Summary
 void add(int index, long k)
           
 void add(int index, Long k)
           
 boolean add(long k)
           
 boolean add(Long k)
          Delegates to the corresponding type-specific method.
 boolean addAll(Collection<? extends Long> c)
          Adds all elements of the given collection to this collection.
 boolean addAll(int i, Collection<? extends Long> c)
           
 boolean addAll(int i, LongCollection c)
           
 boolean addAll(int i, LongList c)
           
 boolean addAll(LongCollection c)
          Adds all elements of the given type-specific collection to this collection.
 boolean addAll(LongList c)
           
 void addElements(int index, long[] a)
          Add (hopefully quickly) elements to this type-specific list.
 void addElements(int index, long[] a, int offset, int length)
          Add (hopefully quickly) elements to this type-specific list.
 Object clone()
           
 int compareTo(List<? extends Long> o)
           
 Long get(int i)
           
 void getElements(int from, long[] a, int offset, int length)
          Copies (hopefully quickly) elements of this type-specific list into the given array.
 long getLong(int i)
           
 int indexOf(long k)
           
 int indexOf(Object k)
           
 int lastIndexOf(long k)
           
 int lastIndexOf(Object k)
           
 LongListIterator listIterator()
          Returns a type-specific list iterator on the list.
 LongListIterator listIterator(int i)
          Returns a type-specific list iterator on the list starting at a given index.
 LongIterator longIterator()
          Deprecated. 
 LongListIterator longListIterator()
          Deprecated. 
 LongListIterator longListIterator(int i)
          Deprecated. 
 LongList longSubList(int from, int to)
          Deprecated. 
 Long remove(int k)
           
 boolean removeAll(Collection<?> c)
          Remove from this collection all elements in the given collection.
 void removeElements(int from, int to)
          Removes (hopefully quickly) elements of this type-specific list.
 long removeLong(int i)
           
 long set(int index, long k)
           
 Long set(int index, Long k)
           
 void size(int s)
          Sets the size of this list.
 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.LongCollections.EmptyCollection
clear, contains, containsAll, equals, hashCode, iterator, rem, removeAll, retainAll, size, toArray, toLongArray, toLongArray
 
Methods inherited from class it.unimi.dsi.fastutil.longs.AbstractLongCollection
contains, containsAll, isEmpty, rem, remove, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.fastutil.longs.LongList
iterator
 
Methods inherited from interface java.util.List
clear, contains, containsAll, equals, hashCode, isEmpty, remove, retainAll, size, toArray, toArray
 
Methods inherited from interface it.unimi.dsi.fastutil.longs.LongCollection
contains, containsAll, rem, removeAll, retainAll, toArray, toArray, toLongArray, toLongArray
 

Field Detail

serialVersionUID

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

add

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

add

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

removeLong

public long removeLong(int i)
Specified by:
removeLong in interface LongList
See Also:
List.remove(int)

set

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

indexOf

public int indexOf(long k)
Specified by:
indexOf in interface LongList
See Also:
List.indexOf(Object)

lastIndexOf

public int lastIndexOf(long k)
Specified by:
lastIndexOf in interface LongList
See Also:
List.lastIndexOf(Object)

addAll

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

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

addAll

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

removeAll

public boolean removeAll(Collection<?> c)
Description copied from class: AbstractLongCollection
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<Long>
Specified by:
removeAll in interface List<Long>
Overrides:
removeAll in class AbstractLongCollection
Parameters:
c - a collection.
Returns:
true if this collection changed as a result of the call.

get

public Long get(int i)
Specified by:
get in interface List<Long>

addAll

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

Specified by:
addAll in interface LongCollection
Overrides:
addAll in class LongCollections.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(LongList c)
Specified by:
addAll in interface LongList
See Also:
List.add(int,Object)

addAll

public boolean addAll(int i,
                      LongCollection c)
Specified by:
addAll in interface LongList
See Also:
List.add(int,Object)

addAll

public boolean addAll(int i,
                      LongList c)
Specified by:
addAll in interface LongList
See Also:
List.add(int,Object)

add

public void add(int index,
                Long k)
Specified by:
add in interface List<Long>

add

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

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

set

public Long set(int index,
                Long k)
Specified by:
set in interface List<Long>

getLong

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

remove

public Long remove(int k)
Specified by:
remove in interface List<Long>

indexOf

public int indexOf(Object k)
Specified by:
indexOf in interface List<Long>

lastIndexOf

public int lastIndexOf(Object k)
Specified by:
lastIndexOf in interface List<Long>

longIterator

@Deprecated
public LongIterator longIterator()
Deprecated. 

Description copied from class: AbstractLongCollection
Delegates to the new covariantly stronger generic method.

Specified by:
longIterator in interface LongCollection
Overrides:
longIterator in class AbstractLongCollection
See Also:
LongCollection.iterator()

listIterator

public LongListIterator listIterator()
Description copied from interface: LongList
Returns a type-specific list iterator on the list.

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

listIterator

public LongListIterator listIterator(int i)
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>
See Also:
LongList.listIterator(int)

longListIterator

@Deprecated
public LongListIterator longListIterator()
Deprecated. 

Description copied from interface: LongList
Returns a type-specific list iterator on the list.

Specified by:
longListIterator in interface LongList
See Also:
LongList.listIterator()

longListIterator

@Deprecated
public LongListIterator longListIterator(int i)
Deprecated. 

Description copied from interface: LongList
Returns a type-specific list iterator on the list starting at a given index.

Specified by:
longListIterator in interface LongList
See Also:
LongList.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>
See Also:
List.subList(int,int)

longSubList

@Deprecated
public LongList longSubList(int from,
                                       int to)
Deprecated. 

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.

Specified by:
longSubList in interface LongList
See Also:
List.subList(int,int)

getElements

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

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

Specified by:
removeElements in interface LongList
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 interface: LongList
Add (hopefully quickly) elements to this type-specific list.

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

addElements

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

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

size

public void size(int s)
Description copied from interface: LongList
Sets the size of this 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 LongList
Parameters:
s - the new size.

compareTo

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

clone

public Object clone()
Overrides:
clone in class Object