|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSystem.Collections.ObjectModel.Collection<T>
public class Collection<T>
Provides the base class for a generic collection.
Constructor Summary | |
---|---|
Collection()
Initializes a new instance of the Collection<> class that is empty. |
|
Collection(java.util.List<T> list)
Initializes a new instance of the Collection<> class as a wrapper for the specified list. |
Method Summary | |
---|---|
void |
Add(T item)
Adds an object to the end of the Collection<>. |
void |
Clear()
Removes all elements from the Collection<>. |
protected void |
ClearItems()
Removes all elements from the Collection<>. |
int |
Count()
Gets the number of elements actually contained in the Collection<>. |
T |
get(int index)
Gets the element at the specified index. |
int |
IndexOf(T item)
Searches for the specified object and returns the zero-based index of the first occurrence within the entire Collection<>. |
void |
Insert(int index,
T item)
Inserts an element into the Collection<> at the specified index. |
protected void |
InsertItem(int index,
T item)
Inserts an element into the Collection<> at the specified index. |
java.util.Iterator<T> |
iterator()
|
protected void |
RemoveItem(int index)
Removes the element at the specified index of the Collection<>. |
void |
set(int index,
T item)
Sets the element at the specified index. |
protected void |
SetItem(int index,
T item)
Replaces the element at the specified index. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Collection()
public Collection(java.util.List<T> list)
list
- The list that is wrapped by the new collection.Method Detail |
---|
public T get(int index)
index
- The zero-based index of the element to get.
public void set(int index, T item)
index
- The zero-based index of the element to set.item
- The new value for the element at the specified index. The value can be null for reference types.public void Add(T item)
item
- The object to be added to the end of the Collection<>. The value can be null for reference types.public java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
public void Clear()
protected void ClearItems()
public int Count()
public int IndexOf(T item)
item
- The object to locate in the List<>. The value can be null for reference types.
public void Insert(int index, T item)
index
- The object to insert. The value can be null for reference types.item
- The zero-based index at which item should be inserted.protected void InsertItem(int index, T item)
index
- The object to insert. The value can be null for reference types.item
- The zero-based index at which item should be inserted.protected void RemoveItem(int index)
index
- The zero-based index of the element to remove.protected void SetItem(int index, T item)
index
- The zero-based index of the element to replace.item
- The new value for the element at the specified index. The value can be null for reference types.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |