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

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

public static class ShortLists.SynchronizedList
extends ShortCollections.SynchronizedCollection
implements ShortList, java.io.Serializable

A synchronized wrapper class for lists.

See Also:
Serialized Form

Method Summary
 void add(int i, short k)
           
 void add(int i, java.lang.Short k)
           
 boolean addAll(int index, java.util.Collection<? extends java.lang.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(java.util.List<? extends java.lang.Short> o)
           
 boolean equals(java.lang.Object o)
           
 java.lang.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(java.lang.Object o)
           
 int indexOf(short k)
           
 ShortListIterator iterator()
          Returns a type-specific iterator on the elements of this collection.
 int lastIndexOf(java.lang.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.
 java.lang.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)
           
 java.lang.Short set(int index, java.lang.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.SynchronizedCollection
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
 

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,
                      java.util.Collection<? extends java.lang.Short> c)
Specified by:
addAll in interface java.util.List<java.lang.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 java.lang.Iterable<java.lang.Short>
Specified by:
iterator in interface java.util.Collection<java.lang.Short>
Specified by:
iterator in interface java.util.List<java.lang.Short>
Overrides:
iterator in class ShortCollections.SynchronizedCollection
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 java.util.List<java.lang.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 java.util.List<java.lang.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 java.util.List<java.lang.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(java.lang.Object o)
Specified by:
equals in interface java.util.Collection<java.lang.Short>
Specified by:
equals in interface java.util.List<java.lang.Short>
Overrides:
equals in class java.lang.Object

hashCode

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

compareTo

public int compareTo(java.util.List<? extends java.lang.Short> o)
Specified by:
compareTo in interface java.lang.Comparable<java.util.List<? extends java.lang.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(int index,
                      ShortList l)
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)

get

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

add

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

set

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

remove

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

indexOf

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

lastIndexOf

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