UniversitySystem
-studentList: ArrayList <Student>
Collections
+sort(): ArrayList<Student>
Student
-SocSec: integer-name: String
+getCurrentElement()+getNextElement()+swap()
ComparableInterface
+compareTo(Student: otherStudent): integer
+has
+uses
Model::Main
SequenceDiagram1interaction
Lifeline1: UniversitySystem Lifeline2: Collections
sort method hasArrayList ofstudents inparameter
Student1: Student
returnsstudent1
returnsstudent2
CompareStudentsloop
swapalt
[student1.compareTo(student2) > 0 ]
[else] donothing
if statement istrue swapstudent 1 and 2
1 : sort()
2 : compareTo(Student: otherStudent)
3 : getCurrentElement()
4 : getNextElement()
5 : swap()
Collaboration1::Interaction1::SequenceDiagram1