NonGenericList
Inheritance: java.lang.Object
All Implemented Interfaces: java.util.List
public class NonGenericList implements List
Non generic list of objects
Constructors
| Constructor | Description |
|---|---|
| NonGenericList(List list) | Initializes a new instance of the NonGenericList class. |
Methods
| Method | Description |
|---|---|
| getList() | |
| addItem(Object value) | Adds an item to the System.Collections.IList. |
| clear() | Removes all items from the System.Collections.IList. |
| contains(Object value) | Determines whether the System.Collections.IList contains a specific value. |
| indexOf(Object value) | Determines the index of a specific item in the System.Collections.IList. |
| insertItem(int index, Object value) | Inserts an item to the System.Collections.IList at the specified index. |
| get(int index) | Gets the element at the specified index. |
| set(int index, Object value) | Sets the element at the specified index. |
| removeItem(Object value) | Removes the first occurrence of a specific object from the System.Collections.IList. |
| removeAt(int index) | Removes the System.Collections.IList item at the specified index. |
| size() | Gets the number of elements contained in the 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() | Returns an enumerator that iterates through a collection. |
| toArray(Object[] a) |
NonGenericList(List list)
public NonGenericList(List list)
Initializes a new instance of the NonGenericList class.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| list | java.util.List | The list - container of objects. |
getList()
public List getList()
Returns: java.util.List
addItem(Object value)
public int addItem(Object value)
Adds an item to the System.Collections.IList.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | java.lang.Object | The System.Object to add to the System.Collections.IList. |
Returns: int - The position into which the new element was inserted.
clear()
public void clear()
Removes all items from the System.Collections.IList.
contains(Object value)
public boolean contains(Object value)
Determines whether the System.Collections.IList contains a specific value.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | java.lang.Object | The System.Object to locate in the System.Collections.IList. |
Returns:
boolean - true if the System.Object is found in the System.Collections.IList; otherwise, false.
indexOf(Object value)
public int indexOf(Object value)
Determines the index of a specific item in the System.Collections.IList.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | java.lang.Object | The System.Object to locate in the System.Collections.IList. |
Returns:
int - The index of value if found in the list; otherwise, -1.
insertItem(int index, Object value)
public void insertItem(int index, Object value)
Inserts an item to the System.Collections.IList at the specified index.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| index | int | The zero-based index at which value should be inserted. |
| value | java.lang.Object | The System.Object to insert into the System.Collections.IList. |
get(int index)
public Object get(int index)
Gets the element at the specified index.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| index | int | The index. |
Returns: java.lang.Object - the element at the specified index.
set(int index, Object value)
public Object set(int index, Object value)
Sets the element at the specified index.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| index | int | The index. |
| value | java.lang.Object |
Returns: java.lang.Object
removeItem(Object value)
public void removeItem(Object value)
Removes the first occurrence of a specific object from the System.Collections.IList.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | java.lang.Object | The System.Object to remove from the System.Collections.IList. |
removeAt(int index)
public void removeAt(int index)
Removes the System.Collections.IList item at the specified index.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| index | int | The zero-based index of the item to remove. |
size()
public int size()
Gets the number of elements contained in the 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:
| Parameter | Type | Description |
|---|---|---|
| o | java.lang.Object |
Returns: boolean
remove(Object o)
public boolean remove(Object o)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| o | java.lang.Object |
Returns: boolean
containsAll(Collection c)
public boolean containsAll(Collection c)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| c | java.util.Collection |
Returns: boolean
addAll(Collection c)
public boolean addAll(Collection c)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| c | java.util.Collection |
Returns: boolean
addAll(int index, Collection c)
public boolean addAll(int index, Collection c)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| index | int | |
| c | java.util.Collection |
Returns: boolean
removeAll(Collection c)
public boolean removeAll(Collection c)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| c | java.util.Collection |
Returns: boolean
retainAll(Collection c)
public boolean retainAll(Collection c)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| c | java.util.Collection |
Returns: boolean
add(int index, Object element)
public void add(int index, Object element)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| index | int | |
| element | java.lang.Object |
remove(int index)
public Object remove(int index)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| index | int |
Returns: java.lang.Object
lastIndexOf(Object o)
public int lastIndexOf(Object o)
Parameters:
| Parameter | 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:
| Parameter | 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:
| Parameter | Type | Description |
|---|---|---|
| fromIndex | int | |
| toIndex | int |
Returns: java.util.List<java.lang.Object>
iterator()
public Iterator iterator()
Returns an enumerator that iterates through a collection.
Returns:
java.util.Iterator - An System.Collections.IEnumerator object that can be used to iterate through the collection.
toArray(Object[] a)
public Object[] toArray(Object[] a)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| a | java.lang.Object[] |
Returns: java.lang.Object[]