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<Object> |
listIterator() |
ListIterator<Object> |
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<Object> |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
Object[] |
toArray(Object[] a) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, replaceAll, sort, spliterator
parallelStream, removeIf, stream
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
.
clear
in interface Collection
clear
in interface List
public boolean contains(Object value)
Determines whether the System.Collections.IList
contains a specific value.
contains
in interface Collection
contains
in interface List
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
.
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.
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
.
size
in interface Collection
size
in interface List
public boolean isEmpty()
isEmpty
in interface Collection
isEmpty
in interface List
public Object[] toArray()
toArray
in interface Collection
toArray
in interface List
public boolean add(Object o)
add
in interface Collection
add
in interface List
public boolean remove(Object o)
remove
in interface Collection
remove
in interface List
public boolean containsAll(Collection c)
containsAll
in interface Collection
containsAll
in interface List
public boolean addAll(Collection c)
addAll
in interface Collection
addAll
in interface List
public boolean addAll(int index, Collection c)
public boolean removeAll(Collection c)
removeAll
in interface Collection
removeAll
in interface List
public boolean retainAll(Collection c)
retainAll
in interface Collection
retainAll
in interface List
public int lastIndexOf(Object o)
lastIndexOf
in interface List
public ListIterator<Object> listIterator()
listIterator
in interface List
public ListIterator<Object> listIterator(int index)
listIterator
in interface List
public Iterator iterator()
Returns an enumerator that iterates through a collection.