Namespace EasyXLS.Util
Class List
System.Object
System.Collections.ArrayList
EasyXLS.Util.List
System.Collections.ArrayList
EasyXLS.Util.List
public class List
extends System.Collections.ArrayList
This class simulates a list of objects.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddElement(System.Object value) Adds a new element to the list.voidclear()Removes all the elements from this listClone()Creates a clone of this listSystem.ObjectelementAt(int index) Returns the element from the specified indexvoidinsertElementAt(System.Object value, int index) Inserts a new element at the specified index.voidremoveElementAt(int index) Removes from the list the element at the specified positionvoidsetCapacity(int capacity) Increases the capacity of this list, if necessary, to ensure that it can hold at least the number of components specified by the minimum capacity argument.voidsetElementAt(System.Object value, int index) Sets the element at the specified index to be the specified object The previous element at that position is discardedintsize()Returns the number of elements in this listMethods inherited from class System.Collections.ArrayList
add, add, addAll, addAll, capacity, clone, contains, containsAll, copyInto, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeIf, replaceAll, retainAll, set, setSize, sort, spliterator, subList, toArray, toArray, toString, trimToSizeMethods inherited from class System.Object
getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, reversed
-
Constructor Details
-
List
public List()Creates an empty list. -
List
public List(int size) Creates an empty list that has the specified initial capacity.- Parameters:
size- the initial capacity
-
-
Method Details
-
size
public int size()Returns the number of elements in this list- Returns:
- the number of elements in this list
- See Also:
-
addElement
public void addElement(System.Object value) Adds a new element to the list.- Parameters:
value- the element to be added- See Also:
-
elementAt
public System.Object elementAt(int index) Returns the element from the specified index- Parameters:
index- the index of the element- Returns:
- the element from the specified index
- See Also:
-
insertElementAt
public void insertElementAt(System.Object value, int index) Inserts a new element at the specified index.- Parameters:
value- the element to be insertedindex- the index where to insert the new element- See Also:
-
removeElementAt
public void removeElementAt(int index) Removes from the list the element at the specified position- Parameters:
index- the index of the element to be removed- See Also:
-
setElementAt
public void setElementAt(System.Object value, int index) Sets the element at the specified index to be the specified object The previous element at that position is discarded- Parameters:
value- the element to be setindex- the specified index- See Also:
-
clear
public void clear()Removes all the elements from this list -
Clone
-
setCapacity
public void setCapacity(int capacity) Increases the capacity of this list, if necessary, to ensure that it can hold at least the number of components specified by the minimum capacity argument.- Parameters:
capacity- the capacity of the array
-