|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.emory.mathcs.util.collections.shorts.AbstractShortCollection
edu.emory.mathcs.util.collections.shorts.ShortArrayList
Array-based list of short numbers.
| Constructor Summary | |
ShortArrayList()
Creates a ShortArrayList with initial capacity of 10. |
|
ShortArrayList(int initialCapacity)
Creates a ShortArrayList with the specified initial capacity. |
|
ShortArrayList(ShortCollection c)
Creates a ShortArrayList, copying to it all elements from the specified short collection, in the order as returned by that collection's iterator. |
|
| Method Summary | |
boolean |
add(short e)
Attempts to add the specified number to this collection. |
boolean |
addAll(int index,
ShortCollection c)
|
boolean |
addAll(ShortCollection c)
Attempts to add to this collection all the numbers contained in the specified collection. |
void |
addAt(int index,
short e)
Adds the value at the specified index, and moves elements starting at index to the right. |
void |
clear()
Removes all the numbers from this collection. |
boolean |
contains(short e)
Returns true if this collection contains specified number; false otherwise. |
boolean |
equals(java.lang.Object o)
|
short |
getAt(int index)
Returns the value at the specified index. |
int |
hashCode()
|
int |
indexOf(short e)
Returns the smallest index at which the list contains the specified number. |
boolean |
isEmpty()
Returns true if this collection is empty; false otherwise. |
ShortIterator |
iterator()
Returns the iterator over numbers contained in this collection. |
int |
lastIndexOf(short e)
Returns the largest index at which the list contains the specified number. |
ShortListIterator |
listIterator()
|
ShortListIterator |
listIterator(int index)
|
boolean |
remove(short e)
Attempts to remove the specified number from this collection. |
short |
removeAt(int index)
Removes the value at the specified index, and shifts elements starting at index+1 to the left. |
short |
setAt(int index,
short e)
Sets the value at the specified index. |
int |
size()
Returns the number of elements in this collection. |
ShortList |
subList(int fromIndex,
int toIndex)
|
short[] |
toArray()
Returns the newly allocated array containing all numbers from this collection, in the order returned by its iterator. |
short[] |
toArray(short[] a)
Returns an array containing all of the numbers in this collection. |
| Methods inherited from class edu.emory.mathcs.util.collections.shorts.AbstractShortCollection |
containsAll, removeAll, retainAll, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.emory.mathcs.util.collections.shorts.ShortList |
containsAll, removeAll, retainAll |
| Constructor Detail |
public ShortArrayList()
public ShortArrayList(int initialCapacity)
public ShortArrayList(ShortCollection c)
| Method Detail |
public int size()
ShortCollection
size in interface ShortListsize in class AbstractShortCollectionpublic boolean isEmpty()
ShortCollection
isEmpty in interface ShortListisEmpty in class AbstractShortCollectionpublic boolean contains(short e)
ShortCollection
contains in interface ShortListcontains in class AbstractShortCollectionpublic ShortIterator iterator()
ShortCollection
iterator in interface ShortListiterator in class AbstractShortCollectionpublic short[] toArray()
ShortCollection
toArray in interface ShortListtoArray in class AbstractShortCollectionpublic short[] toArray(short[] a)
ShortCollectionIf this collection makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order.
Like the ShortCollection.toArray() method, this method acts as bridge between
array-based and collection-based APIs. Further, this method may,
under certain circumstances, be used to save allocation costs.
toArray in interface ShortListtoArray in class AbstractShortCollectionpublic boolean add(short e)
ShortCollection
add in interface ShortListadd in class AbstractShortCollectionpublic boolean remove(short e)
ShortCollection
remove in interface ShortListremove in class AbstractShortCollectionpublic boolean addAll(ShortCollection c)
ShortCollection
addAll in interface ShortListaddAll in class AbstractShortCollection
public boolean addAll(int index,
ShortCollection c)
addAll in interface ShortListpublic void clear()
ShortCollection
clear in interface ShortListclear in class AbstractShortCollectionpublic boolean equals(java.lang.Object o)
equals in interface ShortListpublic int hashCode()
hashCode in interface ShortListpublic short getAt(int index)
ShortList
getAt in interface ShortListindex - the index to retrieve the value from.
public short setAt(int index,
short e)
ShortList
setAt in interface ShortListindex - the index to set the value at.e - the new value.
public void addAt(int index,
short e)
ShortList
addAt in interface ShortListindex - the index to add the value at.e - the new value.public short removeAt(int index)
ShortList
removeAt in interface ShortListindex - the index to remove the value from.
public int indexOf(short e)
ShortList
indexOf in interface ShortListe - the number to look for
public int lastIndexOf(short e)
ShortList
lastIndexOf in interface ShortListe - the number to look for
public ShortListIterator listIterator()
listIterator in interface ShortListpublic ShortListIterator listIterator(int index)
listIterator in interface ShortList
public ShortList subList(int fromIndex,
int toIndex)
subList in interface ShortList
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||