Package com.gophers.structures.domain
Class Submission
java.lang.Object
com.gophers.structures.domain.Submission
Singleton class representing a student's submission, including compilation
status and file loading.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Class<?>Retrieves a class by its name using the submission's class loader.static SubmissiongetInstance(String submissionDirectory) Retrieves the singleton instance of Submission.static StringGets the directory path of the submission.static booleanChecks if the submission was successfully compiled.static voidresetInstance(String newSubmissionDirectory) Resets the singleton instance with a new submission directory.
-
Method Details
-
getInstance
Retrieves the singleton instance of Submission. Creates one if it does not exist.- Parameters:
submissionDirectory- Path to the submission directory.- Returns:
- The singleton instance of Submission.
-
resetInstance
Resets the singleton instance with a new submission directory.- Parameters:
newSubmissionDirectory- Path to the new submission directory.
-
isCompiled
public static boolean isCompiled()Checks if the submission was successfully compiled.- Returns:
- True if compilation was successful, otherwise false.
-
getClass
Retrieves a class by its name using the submission's class loader.- Parameters:
className- Name of the class to load.- Returns:
- The loaded class or null if not found.
-
getSubmissionDirectory
Gets the directory path of the submission.- Returns:
- The submission directory path.
-