it.unimi.dsi.fastutil.shorts
Class ShortLists.UnmodifiableList

java.lang.Object
  extended by it.unimi.dsi.fastutil.shorts.ShortCollections.UnmodifiableCollection
      extended by it.unimi.dsi.fastutil.shorts.ShortLists.UnmodifiableList
All Implemented Interfaces:
ShortCollection, ShortIterable, ShortList, Serializable, Comparable<List<? extends Short>>, Iterable<Short>, Collection<Short>, List<Short>
Enclosing class:
ShortLists

public static class ShortLists.UnmodifiableList
extends ShortCollections.UnmodifiableCollection
implements ShortList, Serializable

An unmodifiable wrapper class for lists.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
           
 
Method Summary
 void add(int i, short k)
           
 void add(int i, Short k)
           
 boolean addAll(int index, Collection<? extends Short> c)
           
 boolean addAll(int index, ShortCollection c)
           
 boolean addAll(int index, ShortList l)
           
 boolean addAll(ShortList l)
           
 void addElements(int index, short[] a)
          Add (hopefully quickly) elements to this type-specific list.
 void addElements(int index, short[] a, int offset, int length)
          Add (hopefully quickly) elements to this type-specific list.
 int compareTo(List<? extends Short> o)
           
 boolean equals(Object o)
           
 Short get(int i)
           
 void getElements(int from, short[] a, int offset, int length)
          Copies (hopefully quickly) elements of this type-specific list into the given array.
 short getShort(int i)
           
 int hashCode()
           
 int indexOf(Object o)
           
 int indexOf(short k)
           
 ShortListIterator iterator()
          Returns a type-specific iterator on the elements of this collection.
 int lastIndexOf(Object o)
           
 int lastIndexOf(short k)
           
 ShortListIterator listIterator()
          Returns a type-specific list iterator on the list.
 ShortListIterator listIterator(int i)
          Returns a type-specific list iterator on the list starting at a given index.
 Short remove(int i)
           
 void removeElements(int from, int to)
          Removes (hopefully quickly) elements of this type-specific list.
 short removeShort(int i)
           
 short set(int i, short k)
           
 Short set(int index, Short k)
           
 ShortListIterator shortListIterator()
          Deprecated. 
 ShortListIterator shortListIterator(int i)
          Deprecated. 
 ShortList shortSubList(int from, int to)
          Deprecated. 
 void size(int size)
          Sets the size of this list.
 ShortList 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.shorts.ShortCollections.UnmodifiableCollection
add, add, addAll, addAll, clear, contains, contains, containsAll, containsAll, isEmpty, rem, remove, removeAll, removeAll, retainAll, retainAll, shortIterator, size, toArray, toArray, toArray, toShortArray, toShortArray, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.fastutil.shorts.ShortList
add
 
Methods inherited from interface java.util.List
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, size, toArray, toArray
 
Methods inherited from interface it.unimi.dsi.fastutil.shorts.ShortCollection
addAll, contains, containsAll, rem, removeAll, retainAll, shortIterator, toArray, toArray, toShortArray, toShortArray
 

Field Detail

serialVersionUID

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

getShort

public short getShort(int i)
Specified by:
getShort in interface ShortList
See Also:
List.get(int)

set

public short set(int i,
                 short k)
Specified by:
set in interface ShortList
See Also:
List.set(int,Object)

add

public void add(int i,
                short k)
Specified by:
add in interface ShortList
See Also:
List.add(int,Object)

removeShort

public short removeShort(int i)
Specified by:
removeShort in interface ShortList
See Also:
List.remove(int)

indexOf

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

lastIndexOf

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

addAll

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

getElements

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

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

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

addElements

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

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

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

size

public void size(int size)
Description copied from interface: ShortList
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 ShortList
Parameters:
size - the new size.

iterator

public ShortListIterator iterator()
Description copied from interface: ShortCollection
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 ShortCollection
Specified by:
iterator in interface ShortIterable
Specified by:
iterator in interface ShortList
Specified by:
iterator in interface Iterable<Short>
Specified by:
iterator in interface Collection<Short>
Specified by:
iterator in interface List<Short>
Overrides:
iterator in class ShortCollections.UnmodifiableCollection
Returns:
a type-specific iterator on the elements of this collection.

listIterator

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

Specified by:
listIterator in interface ShortList
Specified by:
listIterator in interface List<Short>
See Also:
List.listIterator()

listIterator

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

Specified by:
listIterator in interface ShortList
Specified by:
listIterator in interface List<Short>
See Also:
List.listIterator(int)

shortListIterator

@Deprecated
public ShortListIterator shortListIterator()
Deprecated. 

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

Specified by:
shortListIterator in interface ShortList
See Also:
ShortList.listIterator()

shortListIterator

@Deprecated
public ShortListIterator shortListIterator(int i)
Deprecated. 

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

Specified by:
shortListIterator in interface ShortList
See Also:
ShortList.listIterator(int)

subList

public ShortList subList(int from,
                         int to)
Description copied from interface: ShortList
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 ShortList
Specified by:
subList in interface List<Short>
See Also:
List.subList(int,int)

shortSubList

@Deprecated
public ShortList shortSubList(int from,
                                         int to)
Deprecated. 

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

Specified by:
shortSubList in interface ShortList
See Also:
List.subList(int,int)

equals

public boolean equals(Object o)
Specified by:
equals in interface Collection<Short>
Specified by:
equals in interface List<Short>
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection<Short>
Specified by:
hashCode in interface List<Short>
Overrides:
hashCode in class Object

compareTo

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

addAll

public boolean addAll(int index,
                      ShortCollection c)
Specified by:
addAll in interface ShortList
See Also:
List.add(int,Object)

addAll

public boolean addAll(ShortList l)
Specified by:
addAll in interface ShortList
See Also:
List.add(int,Object)

addAll

public boolean addAll(int index,
                      ShortList l)
Specified by:
addAll in interface ShortList
See Also:
List.add(int,Object)

get

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

add

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

set

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

remove

public Short remove(int i)
Specified by:
remove in interface List<Short>

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface List<Short>

lastIndexOf

public int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List<Short>