Package MySTARS

Class SwapIndexView

java.lang.Object
MySTARS.View
MySTARS.SwapIndexView

public final class SwapIndexView
extends View
Verifies a second User from Database.USERS and swaps the indices for both the Users.
Since:
2020-11-1
Version:
1.0
Author:
Bhargav
  • Constructor Summary

    Constructors 
    Constructor Description
    SwapIndexView()  
  • Method Summary

    Modifier and Type Method Description
    void print()
    Required method from View.
    private Student verifySecondUser​(java.lang.String courseCode)
    For swapping index with a peer, this method checks if peer is a valid user that is registered for the relevant course.

    Methods inherited from class MySTARS.View

    clearScreen

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • print

      public void print()
      Required method from View. Prints prompts necessary to swap the indices of 2 Students.
      Specified by:
      print in class View
    • verifySecondUser

      private Student verifySecondUser​(java.lang.String courseCode)
      For swapping index with a peer, this method checks if peer is a valid user that is registered for the relevant course.
      Parameters:
      courseCode - The course code, e.g CZ2002
      Returns:
      Student object for the second user