Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/Bins.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*/
public class Bins {
public static final String DATA_FILE = "example.txt";
// ADDED COMMENT!

/**
* Reads list of integer data from the given input.
Expand All @@ -21,7 +22,13 @@ public class Bins {
public List<Integer> readData (Scanner input) {
List<Integer> results = new ArrayList<Integer>();
while (input.hasNext()) {
results.add(input.nextInt());
if (input.hasNextInt()) {
results.add(input.nextInt());
}
else {
break;
}

}
return results;
}
Expand Down
6 changes: 1 addition & 5 deletions src/Disk.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ public String toString () {
@Override
public boolean equals (Object other) {
if (other != null && other instanceof Disk) {
if (myId == ((Disk) other).myId) {
return true;
} else {
return false;
}
return (myId == ((Disk) other).myId);
} else {
return false;
}
Expand Down
18 changes: 18 additions & 0 deletions src/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
netIDs: at200 blz4 myk3 ra102

Readability
Bins.java
No commenting for clarification, would be incredibly useful for the sections which are used for producing disks, placing items into disks, and similarly less apparent sections

Disk.java
Well commented and far easier to understand on simple level

Testability
Testing with inputs that do not fit the proper input (such as strings) can be input to the scanner is important and ensure the code operates under unexpected conditions.
Break statements and closing input streams is important for making the program flexible while also preventing memory leaks.

Input to test for working under improper input� �1 2 3 4 xyz�

Extensibility
The system includes a lot of redundant .print commands and would benefit from these being shortened to single commands with /n
Several functions in Disk.java feature bulky, redundant if/else statements which can be easily simplified