T1 - key with value T2T2 - value for key T1public class PairedCollection<T1,T2> extends java.lang.Object implements IPairedCollection<T1,T2>
| Modifier and Type | Class and Description |
|---|---|
class |
PairedCollection.CollectionIterator
This inner class works as an Iterator which helps iterating over the map contained in the DataSet
This iterator can be used for the purpose of getting all the elements of the DataSet one by one
This class is implemented such that the programmer can have any
object stored in it he/she wants and having ITag as its key.
|
| Constructor and Description |
|---|
PairedCollection()
Creates Instance of PairedCollection
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(T1 objT1)
Returns the status indicating whether the key is present in the collection or not
|
T2 |
get(T1 objT1)
Provides key based accessing over the internal collection.
|
T1[] |
getKeys()
The implementation of this method gets all the keys in the collection.
|
ICollectionIterator<T2> |
iterator()
Returns an iterator over the internal collection
|
void |
put(T1 objT1,
T2 objT2)
Provides a mechanism for adding a key value pair to the collection.
|
T2 |
remove(T1 objT1)
Removes the values associated with the given key.
|
int |
size()
Returns the size of the collection.
|
public ICollectionIterator<T2> iterator()
iterator in interface ICollectionIterable<T2>iterator in interface java.lang.Iterable<T2>public T2 get(T1 objT1)
get in interface IPairedCollection<T1,T2>objT1 - This parameter specifies the key whose corresponding value is to be retrieved.public void put(T1 objT1, T2 objT2)
put in interface IPairedCollection<T1,T2>objT1 - This parameter specifies the key.objT2 - This parameter specifies the value.public boolean contains(T1 objT1)
contains in interface IPairedCollection<T1,T2>objT1 - This parameter specifies the key.public T2 remove(T1 objT1)
remove in interface IPairedCollection<T1,T2>objT1 - key whose mapping value is removed.public int size()
size in interface IPairedCollection<T1,T2>public T1[] getKeys()
getKeys in interface IPairedCollection<T1,T2>