it.unimi.dsi.fastutil.ints
Class IntLists.EmptyList

java.lang.Object
  extended by it.unimi.dsi.fastutil.ints.AbstractIntCollection
      extended by it.unimi.dsi.fastutil.ints.IntCollections.EmptyCollection
          extended by it.unimi.dsi.fastutil.ints.IntLists.EmptyList
All Implemented Interfaces:
IntCollection, IntIterable, IntList, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<java.util.List<? extends java.lang.Integer>>, java.lang.Iterable<java.lang.Integer>, java.util.Collection<java.lang.Integer>, java.util.List<java.lang.Integer>
Enclosing class:
IntLists

public static class IntLists.EmptyList
extends IntCollections.EmptyCollection
implements IntList, java.io.Serializable, java.lang.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
 boolean add(int k)
           
 boolean add(java.lang.Integer k)
          Delegates to the corresponding type-specific method.
 void add(int index, int k)
           
 void add(int index, java.lang.Integer k)
           
 boolean addAll(java.util.Collection<? extends java.lang.Integer> c)
          Adds all elements of the given collection to this collection.
 boolean addAll(IntCollection c)
          Adds all elements of the given type-specific collection to this collection.
 boolean addAll(int i, java.util.Collection<? extends java.lang.Integer> c)
           
 boolean addAll(int i, IntCollection c)
           
 boolean addAll(int i, IntList c)
           
 boolean addAll(IntList c)
           
 void addElements(int index, int[] a)
          Add (hopefully quickly) elements to this type-specific list.
 void addElements(int index, int[] a, int offset, int length)
          Add (hopefully quickly) elements to this type-specific list.
 java.lang.Object clone()
           
 int compareTo(java.util.List<? extends java.lang.Integer> o)
           
 java.lang.Integer get(int i)
           
 void getElements(int from, int[] a, int offset, int length)
          Copies (hopefully quickly) elements of this type-specific list into the given array.
 int getInt(int i)
           
 int indexOf(int k)
           
 int indexOf(java.lang.Object k)
           
 IntIterator intIterator()
          Deprecated. 
 IntListIterator intListIterator()
          Deprecated. 
 IntListIterator intListIterator(int i)
          Deprecated. 
 IntList intSubList(int from, int to)
          Deprecated. 
 int lastIndexOf(int k)
           
 int lastIndexOf(java.lang.Object k)
           
 IntListIterator listIterator()
          Returns a type-specific list iterator on the list.
 IntListIterator listIterator(int i)
          Returns a type-specific list iterator on the list starting at a given index.
 java.lang.Integer remove(int k)
           
 boolean removeAll(java.util.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.
 int removeInt(int i)
           
 int set(int index, int k)
           
 java.lang.Integer set(int index, java.lang.Integer k)
           
 void size(int s)
          Sets the size of this list.
 IntList 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.ints.IntCollections.EmptyCollection
clear, contains, containsAll, equals, hashCode, iterator, rem, removeAll, retainAll, size, toArray, toIntArray, toIntArray
 
Methods inherited from class it.unimi.dsi.fastutil.ints.AbstractIntCollection
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.ints.IntList
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.ints.IntCollection
contains, containsAll, rem, removeAll, retainAll, toArray, toArray, toIntArray, toIntArray
 

Field Detail

serialVersionUID

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

add

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

add

public boolean add(int k)
Specified by:
add in interface IntCollection
Overrides:
add in class IntCollections.EmptyCollection
See Also:
Collection.add(Object)

removeInt

public int removeInt(int i)
Specified by:
removeInt in interface IntList
See Also:
List.remove(int)

set

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

indexOf

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

lastIndexOf

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

addAll

public boolean addAll(java.util.Collection<? extends java.lang.Integer> c)
Description copied from class: AbstractIntCollection
Adds all elements of the given collection to this collection.

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

addAll

public boolean addAll(int i,
                      java.util.Collection<? extends java.lang.Integer> c)
Specified by:
addAll in interface java.util.List<java.lang.Integer>

removeAll

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

get

public java.lang.Integer get(int i)
Specified by:
get in interface java.util.List<java.lang.Integer>

addAll

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

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

addAll

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

addAll

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

add

public void add(int index,
                java.lang.Integer k)
Specified by:
add in interface java.util.List<java.lang.Integer>

add

public boolean add(java.lang.Integer k)
Description copied from class: AbstractIntCollection
Delegates to the corresponding type-specific method.

Specified by:
add in interface java.util.Collection<java.lang.Integer>
Specified by:
add in interface java.util.List<java.lang.Integer>
Overrides:
add in class AbstractIntCollection

set

public java.lang.Integer set(int index,
                             java.lang.Integer k)
Specified by:
set in interface java.util.List<java.lang.Integer>

getInt

public int getInt(int i)
Specified by:
getInt in interface IntList
See Also:
List.get(int)

remove

public java.lang.Integer remove(int k)
Specified by:
remove in interface java.util.List<java.lang.Integer>

indexOf

public int indexOf(java.lang.Object k)
Specified by:
indexOf in interface java.util.List<java.lang.Integer>

lastIndexOf

public int lastIndexOf(java.lang.Object k)
Specified by:
lastIndexOf in interface java.util.List<java.lang.Integer>

intIterator

@Deprecated
public IntIterator intIterator()
Deprecated. 

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

Specified by:
intIterator in interface IntCollection
Overrides:
intIterator in class AbstractIntCollection
See Also:
IntCollection.iterator()

listIterator

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

Specified by:
listIterator in interface IntList
Specified by:
listIterator in interface java.util.List<java.lang.Integer>
See Also:
IntList.listIterator()

listIterator

public IntListIterator listIterator(int i)
Description copied from interface: IntList
Returns a type-specific list iterator on the list starting at a given index.

Specified by:
listIterator in interface IntList
Specified by:
listIterator in interface java.util.List<java.lang.Integer>
See Also:
IntList.listIterator(int)

intListIterator

@Deprecated
public IntListIterator intListIterator()
Deprecated. 

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

Specified by:
intListIterator in interface IntList
See Also:
IntList.listIterator()

intListIterator

@Deprecated
public IntListIterator intListIterator(int i)
Deprecated. 

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

Specified by:
intListIterator in interface IntList
See Also:
IntList.listIterator(int)

subList

public IntList subList(int from,
                       int to)
Description copied from interface: IntList
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 IntList
Specified by:
subList in interface java.util.List<java.lang.Integer>
See Also:
List.subList(int,int)

intSubList

@Deprecated
public IntList intSubList(int from,
                                     int to)
Deprecated. 

Description copied from interface: IntList
Returns a type-specific view of the portion of this list from the index from, inclusive, to the index to, exclusive.

Specified by:
intSubList in interface IntList
See Also:
List.subList(int,int)

getElements

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

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

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

addElements

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

Specified by:
addElements in interface IntList
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,
                        int[] a)
Description copied from interface: IntList
Add (hopefully quickly) elements to this type-specific list.

Specified by:
addElements in interface IntList
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: IntList
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 IntList
Parameters:
s - the new size.

compareTo

public int compareTo(java.util.List<? extends java.lang.Integer> o)
Specified by:
compareTo in interface java.lang.Comparable<java.util.List<? extends java.lang.Integer>>

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object