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