High they are not that stupid sot it said. 2
But there's a sub interface off set. 3
So we look at some interface which was all about uniqueness on Facebook up on chocolate set. 4
Additionally provide the Salling capability in this lesson. 5
They will also look at navigable set the is slap interface of socket set. 6
So it is also a software set and it is implemented by Chrisette which we are going to discuss soon. 7
Shopping we are not is a very important feature of any application. 8
Whenever we have a list of items that need to be sorted in some order if the data is being fetched from 9
the database often ask your queries do the sorting job for us. 10
If you are not aware of what a school is it stands for structured query language and it basically allows 11
us to interact with databases in order to perform actions like fetching data from that database. 12
But sometimes we Mistal have to sort externally that is outside of school we Mistal have to. 13
And that is done that then our job application and thats where they get us up just a reset come into 14
play. 15
And here's an example where a bunch of numbers are socket on the left. 16
The numbers are sorted in ascending order on the right. 17
The numbers are shorter in descending order. 18
And here is another example that a set of bookbinder's are Sautter alphabetically OK. 19
And so these are strings. 20
Similarly we may also how book objects which may have to be sorted by bookbinder's. 21
OK. 22
So how objects yearbook objects on the items. 23
And we want to sort them by bookbinder's. 24
So even objects can be sorted and they can also be sorted using some other criteria too not just the 25
book titles book objects are referenced by object references just know that this also applies to the 26
strings on the left side because strings are also objects in Java. 27
So we could have used the same form of depiction that as representing the strings as objects and having 28
object references referencing them. 29
It is just that I wanted to explicitly highlight the fact that regular user defined Jawa objects can 30
also be Socker sometimes but don't forget that strings are objects as they are used very commonly. 31
And we keep thinking of them as primitives so we could have used the same kind of illustration here 32
for string string. 33
Just like in the case of book objects on here's the definition of socket set as. 34
But Djala API indexed on set and we can see them at that here you just. 35
A range of methods on the first method is a subset method onager done since Stetson which contains the 36
elements between From element and element. 37
So it returns a subset of the original set from element is Ingrosso here like new element is exclusive 38
which means that that element will not be included in the right. 39
Not from element onto element are same than an empty set would be written. 40
Moreover the return set is backed by the original set. 41
What that means is anything is made in the return set will be reflected in the order you know set. 42
And also any changes made in the original set will also be reflected in that attention. 43
Note that the return set belt through an illegal argument exception if you try to insert an element 44
into that set and if that element is outside the range of the right answer that is outside the range 45
off from aliment an element next his headset method which returns a socket set that includes elements 46
that are less than the input argument element. 47
And the third matter is data set which are tons of socket set that includes elements that are greater 48
than or equal to the input argument from element. 49
So try to keep this in mind that in case of bail set it is greater than or equal to that in the case 50
of headset it is strictly less than the input element. 51
Next two that's a classified as and Baun methods which means that they're written the first and last 52
elements in the socket set. 53
Next this competitor muttered Richard done something called a competitor which would have been discussed 54
later when discussing treason but it is something that helps in keeping the elements of the set socket 55
. 56
But if a competitor is not used then a null value is returned which would indicate that a default ordering 57
or natural ordering is used for sharpening the elements both in or ordering on comparator will be discussed 58
later in lesson on the final method is director which was briefly discussed earlier in that greater 59
lesson. 60
It was introduced in July 8 and we said that it is mainly useful for selecting the elements of the collection 61
and probations so that we can process those partitions using separate tracks. 62
So those are the methods and socket set of eustress set on several instances. 63
But it was mostly for keeping the elements sorted and iterating over them. 64
I think I really use this matters but it all depends on the project that we're working on. 65
But generally these are not that commonly used. 66
Also let's not forget that sort of set also has but that it inherits. 67
So these are not the only methods that it has. 68
Next is navigable set which is at some interface or socket set. 69
So it can do everything that a socket set does. 70
But in addition it supports methods that can return the closest matches for given such targets. 71
For instance the louver method here returns the greatest element that is less than the target element 72
. 73
Which is the input to Dometic and it would return a NULL if no such element would be fun. 74
So if we consider the socket set and if the target is summoned before then the load method would return 75
23. 76
Not that target need not be an element in the collection. 77
OK but if Target was five or lower than that then this method would return and not next as a flawed 78
method which is similar to what mattered but it returns the greatest element that is less than or equal 79
to the target element. 80
And in our example it would Ragan's 74 on third method is ceiling which returns the lowest element greater 81
than or equal to the target. 82
And in our example it would be somewhere before once again unfought matter is higher which Anderton's 83
the lowest element greater than target. 84
And in our example it would be 89. 85
Next we have that it did it amateur's one for regular iteration while the other for a derating in the 86
reverse order. 87
Next is descending set. 88
It simply returns the reverse view of the original set. 89
You may observe that invoking an iterator on the set that this particular method returns would be identical 90
to in walking descending into the turn on the or did you not it. 91
So both the methods that help you do it do it in reverse order. 92
Next we how Paul first non-poor lost numerical palmettos from Q On deck interfaces. 93
So these are identical to those matters. 94
Paul first remove the first element and also that it will pull the most the last element under onset 95
on both of them return a null value of the set is empty. 96
Finally there are fewer range really matters that are very similar to the ones we saw earlier in the 97
sort that set these matters specifically take a boolean parameter to indicate whether something is inclusive 98
or not. 99
For instance he had the headsup method has this additional boolean parameter called inclusive. 100
And if it passes through and then this method returns a set that includes elements that are less than 101
or equal to the input argument element. 102
And if you pass a false then two element would be excluded. 103
You can look up the API to see other variations of range methods although we're covering most of them 104
at that here. 105
I would recommend you look up the API at least once because all these methods may also throw some additional 106
exceptions which we are not discussing here. 107
So it might be nice for you to see bli those exceptions are generated and you may also find some additional 108
information that is not discussed here. 109
So that's about it. 110
Our next we will look at reset and did we will do more where we believe some of the methods were disclosed 111
in this lesson. 112
Okay. 113
Thank you.