Repository: TheAlgorithms/Java
Pull request #3071 (2022-05-31 11:16:55)

Fixes: #3012 - Rename CPUalgorithms class to MemoryManagmentAlgorithms
### **Describe your change:**

- [ ] Add an algorithm?
- [x] Fix a bug or typo in an existing algorithm?
- [ ] Documentation change?

#### References

<!-- Add any reference to previous pull-request or issue -->

### **Checklist:**

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] I have read [CONTRIBUTING.md](https://github.com/TheAlgorithms/Java/blob/master/CONTRIBUTING.md).
- [x] This pull request is all my own work -- I have not plagiarized.
- [x] I know that pull requests will not be merged if they fail the automated tests.
- [x] This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
- [x] All new Java files are placed inside an existing directory.
- [x] All filenames are in all uppercase characters with no spaces or dashes.
- [x] All functions and variable names follow Java naming conventions.
- [x] All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
- [x] If this pull request resolves one or more open issues then the commit message contains `Fixes: #{$ISSUE_NO}`.


siriak: Fixes #3012 

Patch:
diff --git a/src/main/java/com/thealgorithms/others/CPUalgorithms.java b/src/main/java/com/thealgorithms/others/MemoryManagementAlgorithms.java
similarity index 97%
rename from src/main/java/com/thealgorithms/others/CPUalgorithms.java
rename to src/main/java/com/thealgorithms/others/MemoryManagementAlgorithms.java
index 89205f98..a5b5d44e 100644
--- a/src/main/java/com/thealgorithms/others/CPUalgorithms.java
+++ b/src/main/java/com/thealgorithms/others/MemoryManagementAlgorithms.java
@@ -5,7 +5,7 @@ package com.thealgorithms.others;
 
 import java.util.ArrayList;
 
-public abstract class CPUalgorithms {
+public abstract class MemoryManagementAlgorithms {
 
     /**
      * Method to allocate memory to blocks according to CPU algorithms.
@@ -26,7 +26,7 @@ public abstract class CPUalgorithms {
 /**
  * @author Dekas Dimitrios
  */
-class BestFitCPU extends CPUalgorithms{
+class BestFitCPU extends MemoryManagementAlgorithms {
 
     private static final int NO_ALLOCATION
             = -255; // if a process has been allocated in position -255,
@@ -110,7 +110,7 @@ class BestFitCPU extends CPUalgorithms{
 /**
  * @author Dekas Dimitrios
  */
-class WorstFitCPU extends CPUalgorithms{
+class WorstFitCPU extends MemoryManagementAlgorithms {
 
     private static final int NO_ALLOCATION
             = -255; // if a process has been allocated in position -255,
@@ -177,7 +177,7 @@ class WorstFitCPU extends CPUalgorithms{
 /**
  * @author Dekas Dimitrios
  */
-class FirstFitCPU extends CPUalgorithms{
+class FirstFitCPU extends MemoryManagementAlgorithms {
 
     private static final int NO_ALLOCATION
             = -255; // if a process has been allocated in position -255,
@@ -236,7 +236,7 @@ class FirstFitCPU extends CPUalgorithms{
 /**
  * @author Alexandros Lemonaris
  */
-class NextFit extends CPUalgorithms{
+class NextFit extends MemoryManagementAlgorithms {
 
     private static final int NO_ALLOCATION
             = -255; // if a process has been allocated in position -255,


Test patch:
diff --git a/src/test/java/com/thealgorithms/others/BestFitCPUTest.java b/src/test/java/com/thealgorithms/others/BestFitCPUTest.java
index d1ab5916..ecc66da6 100644
--- a/src/test/java/com/thealgorithms/others/BestFitCPUTest.java
+++ b/src/test/java/com/thealgorithms/others/BestFitCPUTest.java
@@ -16,7 +16,7 @@ class BestFitCPUTest {
     int [] sizeOfProcesses;
     ArrayList<Integer> memAllocation = new ArrayList<>();
     ArrayList<Integer> testMemAllocation ;
-    CPUalgorithms bestFit = new BestFitCPU();
+     MemoryManagementAlgorithms bestFit = new BestFitCPU();
 
     @Test
     void testFitForUseOfOneBlock() {
@@ -73,4 +73,4 @@ class BestFitCPUTest {
         );
         assertEquals(testMemAllocation, memAllocation);
     }
-}
\ No newline at end of file
+}
diff --git a/src/test/java/com/thealgorithms/others/FirstFitCPUTest.java b/src/test/java/com/thealgorithms/others/FirstFitCPUTest.java
index 45a501c2..18dae680 100644
--- a/src/test/java/com/thealgorithms/others/FirstFitCPUTest.java
+++ b/src/test/java/com/thealgorithms/others/FirstFitCPUTest.java
@@ -16,7 +16,7 @@ class FirstFitCPUTest {
     int [] sizeOfProcesses;
     ArrayList<Integer> memAllocation = new ArrayList<>();
     ArrayList<Integer> testMemAllocation ;
-    CPUalgorithms firstFit = new FirstFitCPU();
+     MemoryManagementAlgorithms firstFit = new FirstFitCPU();
 
     @Test
     void testFitForUseOfOneBlock() {
@@ -73,4 +73,4 @@ class FirstFitCPUTest {
         );
         assertEquals(testMemAllocation, memAllocation);
     }
-}
\ No newline at end of file
+}
diff --git a/src/test/java/com/thealgorithms/others/NextFitTest.java b/src/test/java/com/thealgorithms/others/NextFitTest.java
index 27c17eaf..5a9206df 100644
--- a/src/test/java/com/thealgorithms/others/NextFitTest.java
+++ b/src/test/java/com/thealgorithms/others/NextFitTest.java
@@ -16,7 +16,7 @@ class NextFitCPUTest {
     int [] sizeOfProcesses;
     ArrayList<Integer> memAllocation = new ArrayList<>();
     ArrayList<Integer> testMemAllocation ;
-    CPUalgorithms nextFit = new NextFit();
+     MemoryManagementAlgorithms nextFit = new NextFit();
 
     @Test
     void testFitForUseOfOneBlock() {
@@ -73,4 +73,4 @@ class NextFitCPUTest {
         );
         assertEquals(testMemAllocation, memAllocation);
     }
-}
\ No newline at end of file
+}
diff --git a/src/test/java/com/thealgorithms/others/WorstFitCPUTest.java b/src/test/java/com/thealgorithms/others/WorstFitCPUTest.java
index cb3f58a4..5e9e2a78 100644
--- a/src/test/java/com/thealgorithms/others/WorstFitCPUTest.java
+++ b/src/test/java/com/thealgorithms/others/WorstFitCPUTest.java
@@ -16,7 +16,7 @@ class WorstFitCPUTest {
     int [] sizeOfProcesses;
     ArrayList<Integer> memAllocation = new ArrayList<>();
     ArrayList<Integer> testMemAllocation ;
-    CPUalgorithms worstFit = new WorstFitCPU();
+     MemoryManagementAlgorithms worstFit = new WorstFitCPU();
 
     @Test
     void testFitForUseOfOneBlock() {
@@ -84,4 +84,4 @@ class WorstFitCPUTest {
         );
         assertEquals(testMemAllocation, memAllocation);
     }
-}
\ No newline at end of file
+}