NonGenericList
Inheritance: java.lang.Object
All Implemented Interfaces: java.util.List
public class NonGenericList implements List
Liste non générique d’objets
Constructeurs
| Constructeur | Description |
|---|---|
| NonGenericList(List list) | Initialise une nouvelle instance de la classe NonGenericList. |
Méthodes
| Méthode | Description |
|---|---|
| getList() | |
| addItem(Object value) | Ajoute un élément à la System.Collections.IList. |
| clear() | Supprime tous les éléments de la System.Collections.IList. |
| contains(Object value) | Détermine si la System.Collections.IList contient une valeur spécifique. |
| indexOf(Object value) | Détermine l’index d’un élément spécifique dans la System.Collections.IList. |
| insertItem(int index, Object value) | Insère un élément dans la System.Collections.IList à l’index spécifié. |
| get(int index) | Obtient l’élément à l’index spécifié. |
| set(int index, Object value) | Définit l’élément à l’index spécifié. |
| removeItem(Object value) | Supprime la première occurrence d’un objet spécifique de la System.Collections.IList. |
| removeAt(int index) | Supprime l’élément de la System.Collections.IList à l’index spécifié. |
| size() | Obtient le nombre d’éléments contenus dans la System.Collections.ICollection. |
| isEmpty() | |
| toArray() | |
| add(Object o) | |
| remove(Object o) | |
| containsAll(Collection c) | |
| addAll(Collection c) | |
| addAll(int index, Collection c) | |
| removeAll(Collection c) | |
| retainAll(Collection c) | |
| add(int index, Object element) | |
| remove(int index) | |
| lastIndexOf(Object o) | |
| listIterator() | |
| listIterator(int index) | |
| subList(int fromIndex, int toIndex) | |
| iterator() | Renvoie un énumérateur qui parcourt une collection. |
| toArray(Object[] a) |
NonGenericList(List list)
public NonGenericList(List list)
Initialise une nouvelle instance de la classe NonGenericList.
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| liste | java.util.List | La liste - conteneur d’objets. |
getList()
public List getList()
Returns: java.util.List
addItem(Object value)
public int addItem(Object value)
Ajoute un élément à la System.Collections.IList.
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| valeur | java.lang.Object | L’System.Object à ajouter à la System.Collections.IList. |
Returns: int - La position dans laquelle le nouvel élément a été inséré.
clear()
public void clear()
Supprime tous les éléments de la System.Collections.IList.
contains(Object value)
public boolean contains(Object value)
Détermine si la System.Collections.IList contient une valeur spécifique.
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| valeur | java.lang.Object | L’System.Object à localiser dans la System.Collections.IList. |
Returns:
boolean - vrai si l’System.Object est trouvé dans la System.Collections.IList ; sinon, faux.
indexOf(Object value)
public int indexOf(Object value)
Détermine l’index d’un élément spécifique dans la System.Collections.IList.
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| valeur | java.lang.Object | L’System.Object à localiser dans la System.Collections.IList. |
Returns:
int - L’index de value s’il est trouvé dans la liste ; sinon, -1.
insertItem(int index, Object value)
public void insertItem(int index, Object value)
Insère un élément dans la System.Collections.IList à l’index spécifié.
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| index | int | L’index basé sur zéro auquel value doit être inséré. |
| valeur | java.lang.Object | L’System.Object à insérer dans la System.Collections.IList. |
get(int index)
public Object get(int index)
Obtient l’élément à l’index spécifié.
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| index | int | L’index. |
Returns: java.lang.Object - l’élément à l’index spécifié.
set(int index, Object value)
public Object set(int index, Object value)
Définit l’élément à l’index spécifié.
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| index | int | L’index. |
| valeur | java.lang.Object |
Returns: java.lang.Object
removeItem(Object value)
public void removeItem(Object value)
Supprime la première occurrence d’un objet spécifique de la System.Collections.IList.
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| valeur | java.lang.Object | L’System.Object à supprimer de la System.Collections.IList. |
removeAt(int index)
public void removeAt(int index)
Supprime l’élément de la System.Collections.IList à l’index spécifié.
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| index | int | L’index basé sur zéro de l’élément à supprimer. |
size()
public int size()
Obtient le nombre d’éléments contenus dans la System.Collections.ICollection.
Returns: int
isEmpty()
public boolean isEmpty()
Returns: boolean
toArray()
public Object[] toArray()
Returns: java.lang.Object[]
add(Object o)
public boolean add(Object o)
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| o | java.lang.Object |
Returns: boolean
remove(Object o)
public boolean remove(Object o)
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| o | java.lang.Object |
Returns: boolean
containsAll(Collection c)
public boolean containsAll(Collection c)
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| c | java.util.Collection |
Returns: boolean
addAll(Collection c)
public boolean addAll(Collection c)
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| c | java.util.Collection |
Returns: boolean
addAll(int index, Collection c)
public boolean addAll(int index, Collection c)
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| index | int | |
| c | java.util.Collection |
Returns: boolean
removeAll(Collection c)
public boolean removeAll(Collection c)
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| c | java.util.Collection |
Returns: boolean
retainAll(Collection c)
public boolean retainAll(Collection c)
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| c | java.util.Collection |
Returns: boolean
add(int index, Object element)
public void add(int index, Object element)
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| index | int | |
| élément | java.lang.Object |
remove(int index)
public Object remove(int index)
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| index | int |
Returns: java.lang.Object
lastIndexOf(Object o)
public int lastIndexOf(Object o)
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| o | java.lang.Object |
Returns: int
listIterator()
public ListIterator<Object> listIterator()
Returns: java.util.ListIterator<java.lang.Object>
listIterator(int index)
public ListIterator<Object> listIterator(int index)
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| index | int |
Returns: java.util.ListIterator<java.lang.Object>
subList(int fromIndex, int toIndex)
public List<Object> subList(int fromIndex, int toIndex)
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| fromIndex | int | |
| toIndex | int |
Returns: java.util.List<java.lang.Object>
iterator()
public Iterator iterator()
Renvoie un énumérateur qui parcourt une collection.
Returns:
java.util.Iterator - Un objet System.Collections.IEnumerator qui peut être utilisé pour parcourir la collection.
toArray(Object[] a)
public Object[] toArray(Object[] a)
Parameters:
| Paramètre | Type | Description |
|---|---|---|
| un | java.lang.Object[] |
Returns: java.lang.Object[]