@Test public void testGetSeriesKey() { DefaultWindDataset d = createSampleDataset1(); assertEquals("Series 1", d.getSeriesKey(0)); assertEquals("Series 2", d.getSeriesKey(1)); try { d.getSeriesKey(-1); fail("IllegalArgumentException should have been thrown on negative key"); } catch (IllegalArgumentException e) { assertEquals("Invalid series index: -1", e.getMessage()); } try { d.getSeriesKey(2); fail("IllegalArgumentException should have been thrown on key out of range"); } catch (IllegalArgumentException e) { assertEquals("Invalid series index: 2", e.getMessage()); } }
@Override public Comparable getSeriesKey(int series) { if (series < 0 || series >= getSeriesCount()) { throw new IllegalArgumentException("Invalid series index: " + series); } return this.seriesKeys.get(series); }
DefaultWindDataset extends AbstractXYDataset implements WindDataset, PublicCloneable { @Override public Comparable getSeriesKey(int series) { if (series < 0 || series >= getSeriesCount()) { throw new IllegalArgumentException("Invalid series index: " + series); } return this.seriesKeys.get(series); } }
DefaultWindDataset extends AbstractXYDataset implements WindDataset, PublicCloneable { @Override public Comparable getSeriesKey(int series) { if (series < 0 || series >= getSeriesCount()) { throw new IllegalArgumentException("Invalid series index: " + series); } return this.seriesKeys.get(series); } DefaultWindDataset();  DefaultWindDataset(Object[][][] data);  DefaultWindDataset(String[] seriesNames, Object[][][] data);  DefaultWindDataset(List<String> seriesKeys, Object[][][] data); }
DefaultWindDataset extends AbstractXYDataset implements WindDataset, PublicCloneable { @Override public Comparable getSeriesKey(int series) { if (series < 0 || series >= getSeriesCount()) { throw new IllegalArgumentException("Invalid series index: " + series); } return this.seriesKeys.get(series); } DefaultWindDataset();  DefaultWindDataset(Object[][][] data);  DefaultWindDataset(String[] seriesNames, Object[][][] data);  DefaultWindDataset(List<String> seriesKeys, Object[][][] data); @Override int getSeriesCount(); @Override int getItemCount(int series); @Override Comparable getSeriesKey(int series); @Override Number getX(int series, int item); @Override Number getY(int series, int item); @Override Number getWindDirection(int series, int item); @Override Number getWindForce(int series, int item); static List<String> seriesNameListFromDataArray(Object[][] data); @Override boolean equals(Object obj); }
DefaultWindDataset extends AbstractXYDataset implements WindDataset, PublicCloneable { @Override public Comparable getSeriesKey(int series) { if (series < 0 || series >= getSeriesCount()) { throw new IllegalArgumentException("Invalid series index: " + series); } return this.seriesKeys.get(series); } DefaultWindDataset();  DefaultWindDataset(Object[][][] data);  DefaultWindDataset(String[] seriesNames, Object[][][] data);  DefaultWindDataset(List<String> seriesKeys, Object[][][] data); @Override int getSeriesCount(); @Override int getItemCount(int series); @Override Comparable getSeriesKey(int series); @Override Number getX(int series, int item); @Override Number getY(int series, int item); @Override Number getWindDirection(int series, int item); @Override Number getWindForce(int series, int item); static List<String> seriesNameListFromDataArray(Object[][] data); @Override boolean equals(Object obj);  }