add field and method for writes used
This commit is contained in:
@@ -22,10 +22,10 @@ public class SortResult {
|
|||||||
private String sortType;
|
private String sortType;
|
||||||
private Integer [] sortedArray;
|
private Integer [] sortedArray;
|
||||||
private String comparisonsUsed;
|
private String comparisonsUsed;
|
||||||
// private String swapsUsed;
|
private String writesUsed;
|
||||||
private Duration timeUsed;
|
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;
|
sortType = st;
|
||||||
sortedArray = a;
|
sortedArray = a;
|
||||||
if(c==0){
|
if(c==0){
|
||||||
@@ -34,6 +34,7 @@ public class SortResult {
|
|||||||
else{
|
else{
|
||||||
comparisonsUsed = Long.toString(c);
|
comparisonsUsed = Long.toString(c);
|
||||||
}
|
}
|
||||||
|
writesUsed = Long.toString(w)
|
||||||
timeUsed = t;
|
timeUsed = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,6 +43,7 @@ public class SortResult {
|
|||||||
sortedArray = a;
|
sortedArray = a;
|
||||||
timeUsed = t;
|
timeUsed = t;
|
||||||
comparisonsUsed = "Unknown";
|
comparisonsUsed = "Unknown";
|
||||||
|
writesUsed = "Unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSortType(){
|
public String getSortType(){
|
||||||
@@ -60,8 +62,8 @@ public class SortResult {
|
|||||||
return comparisonsUsed;
|
return comparisonsUsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
//public String getSwapsUsed(){
|
public String getWritesUsed(){
|
||||||
//return swapsUsed;
|
return writesUsed;
|
||||||
//}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user