public class NonGenericList extends Object implements List
Non generic list of objects
Constructor and Description |
---|
NonGenericList(List list)
Initializes a new instance of the
NonGenericList class. |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
Object element) |
boolean |
add(Object o) |
boolean |
addAll(Collection c) |
boolean |
addAll(int index,
Collection c) |
int |
addItem(Object value)
Adds an item to the
System.Collections.IList . |
void |
clear()
Removes all items from the
System.Collections.IList . |
boolean |
contains(Object value)
Determines whether the
System.Collections.IList contains a specific value. |
boolean |
containsAll(Collection c) |
Object |
get(int index)
Gets the element at the specified index.
|
List |
getList() |
int |
indexOf(Object value)
Determines the index of a specific item in the
System.Collections.IList . |
void |
insertItem(int index,
Object value)
Inserts an item to the
System.Collections.IList at the specified index. |
boolean |
isEmpty() |
Iterator |
iterator()
Returns an enumerator that iterates through a collection.
|
int |
lastIndexOf(Object o) |
ListIterator |
listIterator() |
ListIterator |
listIterator(int index) |
Object |
remove(int index) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection c) |
void |
removeAt(int index)
Removes the
System.Collections.IList item at the specified index. |
void |
removeItem(Object value)
Removes the first occurrence of a specific object from the
System.Collections.IList . |
boolean |
retainAll(Collection c) |
Object |
set(int index,
Object value)
Sets the element at the specified index.
|
int |
size()
Gets the number of elements contained in the
System.Collections.ICollection . |
List |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
Object[] |
toArray(Object[] a) |
public NonGenericList(List list)
Initializes a new instance of the NonGenericList
class.
list
- The list - container of objects.public List getList()
public int addItem(Object value)
Adds an item to the System.Collections.IList
.
value
- The System.Object
to add to the System.Collections.IList
.public void clear()
Removes all items from the System.Collections.IList
.
public boolean contains(Object value)
Determines whether the System.Collections.IList
contains a specific value.
value
- The System.Object
to locate in the System.Collections.IList
.System.Object
is found in the System.Collections.IList
; otherwise, false.public int indexOf(Object value)
Determines the index of a specific item in the System.Collections.IList
.
value
- The System.Object
to locate in the System.Collections.IList
.value
if found in the list; otherwise, -1.public void insertItem(int index, Object value)
Inserts an item to the System.Collections.IList
at the specified index.
index
- The zero-based index at which value
should be inserted.value
- The System.Object
to insert into the System.Collections.IList
.public Object get(int index)
Gets the element at the specified index.
index
- The index.public Object set(int index, Object value)
Sets the element at the specified index.
index
- The index.public void removeItem(Object value)
Removes the first occurrence of a specific object from the System.Collections.IList
.
value
- The System.Object
to remove from the System.Collections.IList
.public void removeAt(int index)
Removes the System.Collections.IList
item at the specified index.
index
- The zero-based index of the item to remove.public int size()
Gets the number of elements contained in the System.Collections.ICollection
.
public boolean isEmpty()
public Object[] toArray()
public boolean add(Object o)
public boolean remove(Object o)
public boolean containsAll(Collection c)
public boolean addAll(Collection c)
public boolean addAll(int index, Collection c)
public boolean removeAll(Collection c)
public boolean retainAll(Collection c)
public void add(int index, Object element)
public Object remove(int index)
public int lastIndexOf(Object o)
public ListIterator listIterator()
public ListIterator listIterator(int index)
public List subList(int fromIndex, int toIndex)
public Iterator iterator()
Returns an enumerator that iterates through a collection.
System.Collections.IEnumerator
object that can be used to iterate through the collection.