add field and method for writes used

This commit is contained in:
2020-06-02 13:21:53 -05:00
parent f5a0a78490
commit 826f4ebe0e

View File

@@ -22,10 +22,10 @@ public class SortResult {
private String sortType;
private Integer [] sortedArray;
private String comparisonsUsed;
// private String swapsUsed;
private String writesUsed;
private Duration timeUsed;
public SortResult(String st, Integer[] a, long c, Duration t){
public SortResult(String st, Integer[] a, long c, long w, Duration t){
sortType = st;
sortedArray = a;
if(c==0){
@@ -34,6 +34,7 @@ public class SortResult {
else{
comparisonsUsed = Long.toString(c);
}
writesUsed = Long.toString(w)
timeUsed = t;
}
@@ -42,6 +43,7 @@ public class SortResult {
sortedArray = a;
timeUsed = t;
comparisonsUsed = "Unknown";
writesUsed = "Unknown";
}
public String getSortType(){
@@ -60,8 +62,8 @@ public class SortResult {
return comparisonsUsed;
}
//public String getSwapsUsed(){
//return swapsUsed;
//}
public String getWritesUsed(){
return writesUsed;
}
}