mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-26 14:04:17 +08:00
style: include OCP_OVERLY_CONCRETE_PARAMETER
(#5833)
This commit is contained in:
@ -2,6 +2,7 @@ package com.thealgorithms.scheduling;
|
||||
|
||||
import com.thealgorithms.devutils.entities.ProcessDetails;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.PriorityQueue;
|
||||
@ -15,7 +16,7 @@ public class PreemptivePriorityScheduling {
|
||||
protected final List<ProcessDetails> processes;
|
||||
protected final List<String> ganttChart;
|
||||
|
||||
public PreemptivePriorityScheduling(List<ProcessDetails> processes) {
|
||||
public PreemptivePriorityScheduling(Collection<ProcessDetails> processes) {
|
||||
this.processes = new ArrayList<>(processes);
|
||||
this.ganttChart = new ArrayList<>();
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.thealgorithms.scheduling;
|
||||
|
||||
import com.thealgorithms.devutils.entities.ProcessDetails;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Implementation of Shortest Job First Algorithm: The algorithm allows the waiting process with the
|
||||
@ -87,7 +88,7 @@ public class SJFScheduling {
|
||||
* @return returns the process' with the shortest burst time OR NULL if there are no ready
|
||||
* processes
|
||||
*/
|
||||
private ProcessDetails findShortestJob(ArrayList<ProcessDetails> readyProcesses) {
|
||||
private ProcessDetails findShortestJob(List<ProcessDetails> readyProcesses) {
|
||||
if (readyProcesses.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.thealgorithms.scheduling.diskscheduling;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -24,7 +25,7 @@ public class SSFScheduling {
|
||||
this.currentPosition = currentPosition;
|
||||
}
|
||||
|
||||
public List<Integer> execute(List<Integer> requests) {
|
||||
public List<Integer> execute(Collection<Integer> requests) {
|
||||
List<Integer> result = new ArrayList<>(requests);
|
||||
List<Integer> orderedRequests = new ArrayList<>();
|
||||
|
||||
|
Reference in New Issue
Block a user