T
- The type of elements in the collection.public class ReadOnlyCollection<T>
extends java.lang.Object
implements java.lang.Iterable<T>
Constructor and Description |
---|
ReadOnlyCollection(java.util.List<T> list)
Initializes a new instance of the System.Collections.ObjectModel.ReadOnlyCollection
|
Modifier and Type | Method and Description |
---|---|
boolean |
Contains(T value)
Determines whether an element is in the System.Collections.ObjectModel.ReadOnlyCollection
|
void |
CopyTo(T[] array,
int index)
Copies the entire System.Collections.ObjectModel.ReadOnlyCollection
|
int |
Count()
Gets the number of elements contained in the System.Collections.ObjectModel.ReadOnlyCollection
|
T |
get(int index)
Gets the element at the specified index.
|
protected java.util.List<T> |
getItems()
Returns the System.Collections.Generic.IList
|
int |
IndexOf(T value)
Searches for the specified object and returns the zero-based index of the first occurrence within the entire System.Collections.ObjectModel.ReadOnlyCollection
|
java.util.Iterator<T> |
iterator()
Returns an iterator that iterates through the System.Collections.ObjectModel.ReadOnlyCollection
|
public ReadOnlyCollection(java.util.List<T> list)
list
- The list to wrap.ArgumentNullException
- list is null.public int Count()
protected java.util.List<T> getItems()
public T get(int index)
index
- The zero-based index of the element to get.ArgumentOutOfRangeException
- index is less than zero.-or-index is equal to or greater than System.Collections.ObjectModel.ReadOnlyCollectionpublic boolean Contains(T value)
value
- The object to locate in the System.Collections.ObjectModel.ReadOnlyCollectionpublic void CopyTo(T[] array, int index)
array
- The one-dimensional array that is the destination of the elements copied from System.Collections.ObjectModel.ReadOnlyCollectionindex
- The zero-based index in array at which copying begins.public java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
public int IndexOf(T value)
value
- The object to locate in the System.Collections.Generic.List