@Test public void testGet() { try{ DataStorage.get(BinLabel.BIN_RECENT, 0); fail("Get failed on empty bin: BIN_RECENT"); } catch(NoSuchElementException e) { } try{ DataStorage.get(BinLabel.BIN_TRAIN, 0); fail("Get failed on empty bin: BIN_TRAIN"); } catch(NoSuchElementException e) { } DataStorage.add(BinLabel.BIN_RECENT, fv); FeatureVector recentFV = DataStorage.get(BinLabel.BIN_RECENT, 0); for (int i = 0; i < recentFV.size(); i++) assertEquals("DataStorage.get failed at index 0", recentFV.get(i), fv.get(i), 0.0); assertEquals("DataStorage.get failed", recentFV.getIntClassLabel(), fv.getIntClassLabel()); DataStorage.clear(BinLabel.BIN_RECENT); }
public static synchronized FeatureVector get(BinLabel binLabel, int index) throws NoSuchElementException { if (!data.containsKey(binLabel)) throw new NoSuchElementException(binLabel.toString() + " bin DNE"); return data.get(binLabel).get(index); }
DataStorage { public static synchronized FeatureVector get(BinLabel binLabel, int index) throws NoSuchElementException { if (!data.containsKey(binLabel)) throw new NoSuchElementException(binLabel.toString() + " bin DNE"); return data.get(binLabel).get(index); } }
DataStorage { public static synchronized FeatureVector get(BinLabel binLabel, int index) throws NoSuchElementException { if (!data.containsKey(binLabel)) throw new NoSuchElementException(binLabel.toString() + " bin DNE"); return data.get(binLabel).get(index); }  }
DataStorage { public static synchronized FeatureVector get(BinLabel binLabel, int index) throws NoSuchElementException { if (!data.containsKey(binLabel)) throw new NoSuchElementException(binLabel.toString() + " bin DNE"); return data.get(binLabel).get(index); }  static synchronized FeatureVector get(BinLabel binLabel, int index); static List<FeatureVector> getAll(BinLabel binLabel); static synchronized void add(BinLabel binLabel, FeatureVector fv); static synchronized void clear(BinLabel binLabel); static int binSize(BinLabel binLabel); static synchronized void add(FeatureVector fv); static synchronized FeatureVector getMostRecent(); static synchronized void setDefaultBin(BinLabel binLabel); static void setMaxRecent(int maxRecents); }
DataStorage { public static synchronized FeatureVector get(BinLabel binLabel, int index) throws NoSuchElementException { if (!data.containsKey(binLabel)) throw new NoSuchElementException(binLabel.toString() + " bin DNE"); return data.get(binLabel).get(index); }  static synchronized FeatureVector get(BinLabel binLabel, int index); static List<FeatureVector> getAll(BinLabel binLabel); static synchronized void add(BinLabel binLabel, FeatureVector fv); static synchronized void clear(BinLabel binLabel); static int binSize(BinLabel binLabel); static synchronized void add(FeatureVector fv); static synchronized FeatureVector getMostRecent(); static synchronized void setDefaultBin(BinLabel binLabel); static void setMaxRecent(int maxRecents);  }