T - Spcifies type of which singleCollection is formed.public class SingleCollection<T> extends java.lang.Object implements ISingleCollection<T>
| Constructor and Description |
|---|
SingleCollection()
This constructor creats vector of type T.
|
SingleCollection(int iSize)
This constructor creats collection of size iSize.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T objT)
This method provides a mechanism for adding an elemtn to the collection.
|
boolean |
addAll(java.util.List<T> collection)
Adds any collection into this collection.
|
boolean |
contains(T objT)
Tests if the specified element is peresent in the collection.
|
boolean |
containsAll(ISingleCollection<T> objSingleCollection)
Returns true if this collection contains all of the elements in the specified collection otherwise false.
|
T |
elementAt(int iIndex)
Returns element at specified index.
|
ICollectionIterator<T> |
iterator()
Returns an iterator over the internal collection.
|
void |
remove(int iIndex)
Removes the element at the specified index.
|
void |
remove(java.lang.Object objectToRemove)
Removes the element at the specified index.
|
int |
size()
Returns number of elements in the collection.
|
public SingleCollection()
public SingleCollection(int iSize)
iSize - Size of the collection.public ICollectionIterator<T> iterator()
iterator in interface ICollectionIterable<T>iterator in interface java.lang.Iterable<T>public boolean add(T objT)
add in interface ISingleCollection<T>objT - object specified at the time of instantiation of the implementor class.public boolean addAll(java.util.List<T> collection)
addAll in interface ISingleCollection<T>collection - object of any class collection .public boolean contains(T objT)
contains in interface ISingleCollection<T>objT - object of the type user specifies at the time of instantiation of this interface.public T elementAt(int iIndex)
elementAt in interface ISingleCollection<T>iIndex - the integer indicating the position of the element to be retrieved from the collection.public void remove(int iIndex)
remove in interface ISingleCollection<T>iIndex - position of the element.public void remove(java.lang.Object objectToRemove)
remove in interface ISingleCollection<T>objectToRemove - position of the element.public int size()
size in interface ISingleCollection<T>public boolean containsAll(ISingleCollection<T> objSingleCollection)
containsAll in interface ISingleCollection<T>objSingleCollection - whose elements will be tested for containment in this SingleCollection.