|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.unimi.dsi.fastutil.shorts.AbstractShortCollection
it.unimi.dsi.fastutil.shorts.AbstractShortList
it.unimi.dsi.fastutil.shorts.ShortLists.Singleton
An immutable class representing a type-specific singleton list.
This class may be useful to implement your own in case you subclass a type-specific list.
Nested Class Summary |
Nested classes inherited from class it.unimi.dsi.fastutil.shorts.AbstractShortList |
AbstractShortList.ShortSubList |
Field Summary | |
static long |
serialVersionUID
|
Method Summary | |
void |
add(int i,
short k)
|
boolean |
add(short k)
|
boolean |
addAll(Collection c)
Delegates to a more generic method. |
boolean |
addAll(int i,
Collection c)
|
boolean |
addAll(int i,
List c)
|
boolean |
addAll(int i,
ShortCollection c)
Delegates to a more generic method. |
boolean |
addAll(int i,
ShortList c)
Delegates to a more generic method. |
boolean |
addAll(List c)
|
boolean |
addAll(ShortCollection c)
Delegates to a more generic method. |
boolean |
addAll(ShortList c)
Delegates to a more generic method. |
void |
clear()
|
Object |
clone()
|
boolean |
contains(short k)
|
short |
getShort(int i)
|
boolean |
rem(short k)
Note that this method should be called remove() , but the clash
with the similarly named index-based method in the List interface
forces us to use a distinguished name. |
boolean |
removeAll(Collection c)
Remove from this collection all elements in the given collection. |
boolean |
removeAll(ShortCollection c)
Remove from this collection all elements in the given type-specific collection. |
short |
removeShort(int i)
|
boolean |
retainAll(Collection c)
Retains in this collection only elements from the given collection. |
boolean |
retainAll(ShortCollection c)
Retains in this collection only elements from the given type-specific collection. |
ShortListIterator |
shortListIterator()
Delegates to the corresponding list-iterator method. |
ShortListIterator |
shortListIterator(int i)
Returns a type-specific list iterator on the list starting at a given index. |
ShortList |
shortSubList(int from,
int to)
|
int |
size()
|
void |
size(int size)
Sets the size of this list. |
short[] |
toShortArray()
Returns a primitive type array containing the items of this collection. |
Methods inherited from class it.unimi.dsi.fastutil.shorts.AbstractShortList |
add, addElements, addElements, compareTo, equals, get, getElements, hashCode, indexOf, indexOf, lastIndexOf, lastIndexOf, listIterator, listIterator, peek, peekShort, pop, popShort, push, push, remove, removeElements, set, set, shortIterator, subList, top, topShort, toString |
Methods inherited from class it.unimi.dsi.fastutil.shorts.AbstractShortCollection |
add, contains, containsAll, containsAll, isEmpty, iterator, rem, remove, toArray, toArray, toArray, toShortArray |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
add, contains, containsAll, isEmpty, iterator, remove, toArray, toArray |
Methods inherited from interface it.unimi.dsi.fastutil.shorts.ShortCollection |
containsAll, toArray, toShortArray |
Methods inherited from interface it.unimi.dsi.fastutil.Stack |
isEmpty |
Field Detail |
public static final long serialVersionUID
Method Detail |
public boolean rem(short k)
ShortCollection
remove()
, but the clash
with the similarly named index-based method in the List
interface
forces us to use a distinguished name. For simplicity, the set interfaces reinstates
remove()
.
rem
in interface ShortCollection
rem
in class AbstractShortList
public boolean add(short k)
add
in interface ShortCollection
add
in class AbstractShortList
public void add(int i, short k)
add
in interface ShortList
add
in class AbstractShortList
public short getShort(int i)
getShort
in interface ShortList
List.get(int)
public short removeShort(int i)
removeShort
in interface ShortList
removeShort
in class AbstractShortList
public boolean contains(short k)
contains
in interface ShortCollection
contains
in class AbstractShortList
public boolean addAll(ShortList c)
AbstractShortList
addAll
in interface ShortList
addAll
in class AbstractShortList
public boolean addAll(ShortCollection c)
AbstractShortList
addAll
in interface ShortCollection
addAll
in class AbstractShortList
public boolean addAll(int i, ShortList c)
AbstractShortList
addAll
in interface ShortList
addAll
in class AbstractShortList
public boolean addAll(int i, ShortCollection c)
AbstractShortList
addAll
in interface ShortList
addAll
in class AbstractShortList
public boolean removeAll(ShortCollection c)
AbstractShortCollection
removeAll
in interface ShortCollection
removeAll
in class AbstractShortCollection
c
- a type-specific collection.
true
if this collection changed as a result of the call.public boolean retainAll(ShortCollection c)
AbstractShortCollection
retainAll
in interface ShortCollection
retainAll
in class AbstractShortCollection
c
- a type-specific collection.
true
if this collection changed as a result of the call.public boolean addAll(List c)
public boolean addAll(Collection c)
AbstractShortList
addAll
in interface List
addAll
in class AbstractShortList
public boolean addAll(int i, List c)
public boolean addAll(int i, Collection c)
addAll
in interface List
addAll
in class AbstractShortList
public boolean removeAll(Collection c)
AbstractShortCollection
removeAll
in interface List
removeAll
in class AbstractShortCollection
c
- a collection.
true
if this collection changed as a result of the call.public boolean retainAll(Collection c)
AbstractShortCollection
retainAll
in interface List
retainAll
in class AbstractShortCollection
c
- a collection.
true
if this collection changed as a result of the call.public short[] toShortArray()
ShortCollection
toShortArray
in interface ShortCollection
toShortArray
in class AbstractShortCollection
public ShortListIterator shortListIterator()
AbstractShortList
shortListIterator
in interface ShortList
shortListIterator
in class AbstractShortList
public ShortListIterator shortListIterator(int i)
ShortList
The iterator returned by the List.listIterator()
method and by this
method are identical; however, using this method you can save a type casting.
shortListIterator
in interface ShortList
shortListIterator
in class AbstractShortList
public ShortList shortSubList(int from, int to)
shortSubList
in interface ShortList
shortSubList
in class AbstractShortList
public int size()
size
in interface List
public void size(int size)
ShortList
If the specified size is smaller than the current size, the last elements are
discarded. Otherwise, they are filled with 0/null
/false
.
size
in interface ShortList
size
in class AbstractShortList
public void clear()
clear
in interface List
clear
in class AbstractShortCollection
public Object clone()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |