OK let's not begin by looking at that collection interface which is the root of the collection hierarchy 2
under to present a collection of objects. 3
Now since it is the polymorphically it but what's maximum generality. 4
So whenever possible you should use it to reference objects on some collections like idlest alone triplicates 5
when others like set implementations do not allow triplicates. 6
Similarly some collections like or a list are ordered while others like Hosh set are unordered. 7
Finally even though the collection has different subway interfaces but it has only one bit at sapless 8
under his Carlists abstract collection which It's a skeleton implementation of the collection interface 9
. 10
I recall that is gilet an implementation helps in minimizing the effort needed to implement the corresponding 11
interface and is the declaration of the collection interface reductions and other into Fischl. 12
It did a bill which would enable any collection object to be used in each loops. 13
You did a from Gelada outline package and it has one abstract method. 14
Call it director Victor subclass hospital implemented little when we get them off our list. 15
We will look at the trade and method which I finished implements. 16
So if you want instances of your class to be used for each statement then you need to implement a durable 17
interface and provide an implementation for each character method. 18
Also let's run for the greater unless done notations here they're related to genetics. 19
Unrepaired be clear when we get there. 20
No collection interface includes several fundamental methods common to all collections and they can 21
be broadly classified into three categories. 22
First class of methods can be referred to as basic operations on second and bulk operations on Turdus 23
operations. 24
Let's not look at the methods in each of these categories and hit them at the fall and basic operations 25
Hesters. 26
I admit that I did just add some to remember the collection. 27
It returns a true or false depending on whether the element could be added or not. 28
For instance if the collection does not support bootlick It's odd you are trying to add a duplicate 29
element. 30
Then the method would be done if false indicating that the element was not added. 31
Also the notation in the parameter is genetics related. 32
So let's not worry about it. 33
Also note that the trailing comment says that IDE is an optional operation. 34
It means that a subclass need not supported. 35
That is it will define an empty Agde matter. 36
Buckwalter an exception. 37
Unsupported operation exception which indicates that it does not support an operation unsupported operation 38
exception is an exception class from the jabat underlying package. 39
Just note that we would also see some more optional operations in the collection interface but all the 40
common implementations like de-list Hachette and so on which we are going to discuss later. 41
Do implement all the optional operations. 42
Second is that remote matter visually an element from the collection and it is also an optional operation 43
on TOTUS contains matter. 44
It allows you to check bids or not the collection contains the input element. 45
So it is basically the search method and the size of the collection and 50 is to check whether or not 46
the collection is empty and the final one is that it didn't matter which is inherited from the super 47
interface. 48
A did a poll on this matter return to an instance of iterator. 49
I needed it for is an interface in the Gelada little package and it would help and it did it in the 50
elements of the collection. 51
As mentioned Nodier Vivan look at it did it matter when discussing auto list and here are the methods 52
that both bulk operations on the collection object. 53
Just one is out on motet which adds all the elements in the input collection object to the cut and collection 54
object. 55
Next is it a good one. 56
It would remove all the elements in the cut and collection which are also present in the input collection 57
object. 58
So it is really an all I need is it to remove all that would retain all the elements in the current 59
collection which are also present in the input collection object. 60
In other words elements that are not present in the input collection object will be removed from this 61
contains on cadenced true if the current collection contains all the elements in the collection object 62
and the final one is clear. 63
It simply removes all the elements in that collection so the collection object would be empty. 64
After this method returns. 65
And here are two methods that follow our operations. 66
Both of them are redundant. 67
I'm betting all events in the current collection Highwood in the first method. 68
The added type is object so if needed. 69
You may have to don't cast the elements appropriately in the second method. 70
Type is more specific here JENNETT exploited notation is used and since we did not discuss genetics 71
yet. 72
Let's look at the example provided here. 73
Which should be helpful in the example. 74
As String arrays to know the input to them but there is also an empty string. 75
So the type of the dictionary as well as the Bible to input array should match. 76
If you look at the method declaration you will also see that that is just like an example. 77
Type is same in both the return type as well as the input parameter type. 78
No the elements in the collection should be of the same type as the type of the in pottery or must be 79
a subtype otherwise an exception will be thrown. 80
No. 81
This is what happens if the input array size is less than the collection size. 82
Then a new law is created and is written with the elements in the collection. 83
But if the input array size is greater than or equal to the size of the collection then that's C is 84
return after being fitted with the collection elements. 85
Now if there are any slots left after filling the ID then those slots will be set to none. 86
So those are the array operations and as you can see they act as Bridgemen it's between collections 87
and address so that separate the collection interface on Boucek it opened the J.Y. API. 88
Thank you