/** * If the item at pos is a Number, return its float value. Otherwise if the item is a char[] or * any other type of Object, convert the item to a String and return its float value. * * @param row the row number * @return the float value of the item at row # row. if no such item exists or if the data is not * numeric - returns a value signifying the position is empty, as defined by * SparseFloatColumn. */ public float getFloat(int row) { Object obj = elements.get(row); if (obj != null && isDataNumeric(row)) { return SparseFloatColumn.toFloat(obj); } return (float) SparseDefaultValues.getDefaultDouble(); }
/** * If the item at pos is a Number, return its double value. Otherwise if the item is a char[] or * any other type of Object, convert the item to a String and return its double value by calling * Double.parseDouble() * * @param row the row number * @return the double value of the item at row # row. if no such item exists returns a value * signifying the position is empty, as defined by SparseDoubleColumn. */ public double getDouble(int row) { Object obj = elements.get(row); if (obj != null && isDataNumeric(row)) { return SparseDoubleColumn.toDouble(obj); } return SparseDefaultValues.getDefaultDouble(); }