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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addElement(System.Object value)
Adds a new element to the list.void
clear()
Removes all the elements from this listClone()
Creates a clone of this listSystem.Object
elementAt(int index)
Returns the element from the specified indexvoid
insertElementAt(System.Object value, int index)
Inserts a new element at the specified index.void
removeElementAt(int index)
Removes from the list the element at the specified positionvoid
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.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 discardedint
size()
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, trimToSize
Methods inherited from class System.Object
getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
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(System.Object)
,insertElementAt(System.Object, int)
,removeElementAt(int)
-
addElement
public void addElement(System.Object value)Adds a new element to the list.- Parameters:
value
- the element to be added- See Also:
insertElementAt(System.Object, int)
,removeElementAt(int)
-
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:
addElement(System.Object)
,insertElementAt(System.Object, int)
,removeElementAt(int)
,size()
-
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:
addElement(System.Object)
,removeElementAt(int)
,size()
-
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:
addElement(System.Object)
,insertElementAt(System.Object, int)
,size()
-
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:
addElement(System.Object)
,insertElementAt(System.Object, int)
,removeElementAt(int)
,size()
-
clear
public void clear()Removes all the elements from this list -
Clone
Creates a clone of this list- Returns:
- a clone for the list
-
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
-