@Test public void point2DDatsetFromVTable8() { VTable data = ValueFactory.newVTable(Arrays.<Class<?>>asList(double.class, String.class, double.class), Arrays.asList("x", "y", "z"), Arrays.<Object>asList(new ArrayDouble(1,2,3), Arrays.asList("a", "b", "c"), new ArrayDouble(5,4,6))); Point2DDataset dataset = DatasetConversions.point2DDatasetFromVTable(data, null, null); assertThat(dataset.getCount(), equalTo(3)); assertThat(dataset.getXValues(), equalTo((ListNumber) new ArrayDouble(1,2,3))); assertThat(dataset.getYValues(), equalTo((ListNumber) new ArrayDouble(5,4,6))); }
public static Point2DDataset point2DDatasetFromVTable(VTable vTable, String xColumn, String yColumn) { ListNumber xValues = ValueUtil.numericColumnOf(vTable, xColumn); ListNumber yValues = ValueUtil.numericColumnOf(vTable, yColumn); for (int i = 0; i < vTable.getColumnCount(); i++) { if (vTable.getColumnType(i).isPrimitive()) { if (!vTable.getColumnName(i).equals(xColumn) && !vTable.getColumnName(i).equals(yColumn)) { if (xValues == null) { xValues = (ListNumber) vTable.getColumnData(i); } else if (yValues == null) { yValues = (ListNumber) vTable.getColumnData(i); } } } } if (xValues == null || yValues == null) { throw new IllegalArgumentException("Couldn't find two numeric columns"); } return Point2DDatasets.lineData(xValues, yValues); }
DatasetConversions { public static Point2DDataset point2DDatasetFromVTable(VTable vTable, String xColumn, String yColumn) { ListNumber xValues = ValueUtil.numericColumnOf(vTable, xColumn); ListNumber yValues = ValueUtil.numericColumnOf(vTable, yColumn); for (int i = 0; i < vTable.getColumnCount(); i++) { if (vTable.getColumnType(i).isPrimitive()) { if (!vTable.getColumnName(i).equals(xColumn) && !vTable.getColumnName(i).equals(yColumn)) { if (xValues == null) { xValues = (ListNumber) vTable.getColumnData(i); } else if (yValues == null) { yValues = (ListNumber) vTable.getColumnData(i); } } } } if (xValues == null || yValues == null) { throw new IllegalArgumentException("Couldn't find two numeric columns"); } return Point2DDatasets.lineData(xValues, yValues); } }
DatasetConversions { public static Point2DDataset point2DDatasetFromVTable(VTable vTable, String xColumn, String yColumn) { ListNumber xValues = ValueUtil.numericColumnOf(vTable, xColumn); ListNumber yValues = ValueUtil.numericColumnOf(vTable, yColumn); for (int i = 0; i < vTable.getColumnCount(); i++) { if (vTable.getColumnType(i).isPrimitive()) { if (!vTable.getColumnName(i).equals(xColumn) && !vTable.getColumnName(i).equals(yColumn)) { if (xValues == null) { xValues = (ListNumber) vTable.getColumnData(i); } else if (yValues == null) { yValues = (ListNumber) vTable.getColumnData(i); } } } } if (xValues == null || yValues == null) { throw new IllegalArgumentException("Couldn't find two numeric columns"); } return Point2DDatasets.lineData(xValues, yValues); }  }
DatasetConversions { public static Point2DDataset point2DDatasetFromVTable(VTable vTable, String xColumn, String yColumn) { ListNumber xValues = ValueUtil.numericColumnOf(vTable, xColumn); ListNumber yValues = ValueUtil.numericColumnOf(vTable, yColumn); for (int i = 0; i < vTable.getColumnCount(); i++) { if (vTable.getColumnType(i).isPrimitive()) { if (!vTable.getColumnName(i).equals(xColumn) && !vTable.getColumnName(i).equals(yColumn)) { if (xValues == null) { xValues = (ListNumber) vTable.getColumnData(i); } else if (yValues == null) { yValues = (ListNumber) vTable.getColumnData(i); } } } } if (xValues == null || yValues == null) { throw new IllegalArgumentException("Couldn't find two numeric columns"); } return Point2DDatasets.lineData(xValues, yValues); }  static Point2DDataset point2DDatasetFromVTable(VTable vTable,
            String xColumn, String yColumn); static Point3DWithLabelDataset point3DDatasetFromVTable(VTable vTable,
            String xColumn, String yColumn, String sizeColumn, String colorColumn); static List<Point2DDataset> point2DDatasetsFromVTable(VTable vTable, List<String> xColumns, List<String> yColumns); static Cell2DDataset cell2DDatasetsFromVNumberArray(VNumberArray data); static Range toRange(Display display); static Cell1DDataset cell1DDatasetsFromVNumberArray(VNumberArray data); }
DatasetConversions { public static Point2DDataset point2DDatasetFromVTable(VTable vTable, String xColumn, String yColumn) { ListNumber xValues = ValueUtil.numericColumnOf(vTable, xColumn); ListNumber yValues = ValueUtil.numericColumnOf(vTable, yColumn); for (int i = 0; i < vTable.getColumnCount(); i++) { if (vTable.getColumnType(i).isPrimitive()) { if (!vTable.getColumnName(i).equals(xColumn) && !vTable.getColumnName(i).equals(yColumn)) { if (xValues == null) { xValues = (ListNumber) vTable.getColumnData(i); } else if (yValues == null) { yValues = (ListNumber) vTable.getColumnData(i); } } } } if (xValues == null || yValues == null) { throw new IllegalArgumentException("Couldn't find two numeric columns"); } return Point2DDatasets.lineData(xValues, yValues); }  static Point2DDataset point2DDatasetFromVTable(VTable vTable,
            String xColumn, String yColumn); static Point3DWithLabelDataset point3DDatasetFromVTable(VTable vTable,
            String xColumn, String yColumn, String sizeColumn, String colorColumn); static List<Point2DDataset> point2DDatasetsFromVTable(VTable vTable, List<String> xColumns, List<String> yColumns); static Cell2DDataset cell2DDatasetsFromVNumberArray(VNumberArray data); static Range toRange(Display display); static Cell1DDataset cell1DDatasetsFromVNumberArray(VNumberArray data);  }