risdenk commented on a change in pull request #163: KNOX-2052 - KnoxShellTable 
mean, median, and mode methods
URL: https://github.com/apache/knox/pull/163#discussion_r332280604
 
 

 ##########
 File path: 
gateway-shell/src/main/java/org/apache/knox/gateway/shell/table/KnoxShellTable.java
 ##########
 @@ -76,6 +80,98 @@ public KnoxShellTable value(Comparable<? extends Object> 
value) {
     return col;
   }
 
+  public double[] toDoubleArray(String colName) throws 
IllegalArgumentException {
+    List<Comparable<? extends Object>> col = values(colName);
+    double[] colArray = new double[col.size()];
+    int conversionMethod = 0;
+    for (int i = 0; i < col.size(); i++) {
+      if (i == 0) {
+        if (col.get(i) instanceof Integer) {
+          conversionMethod = INTEGER_CONVERSION_METHOD;
 
 Review comment:
   https://repl.it/repls/GigaLavenderInternalcommand
   
   Shows that it looks like this works just using `Double.valueOf(...)`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to