@Test void write_obj_key_scoredistribution() throws Exception{ TermId termId = TermId.of("MONDO", "001"); Map<TermId, ObjectScoreDistribution> scoreDistributionMap = new HashMap<>(); SortedMap<Double, Double> sortedMap = ImmutableSortedMap.of(0.0, 0.2, 0.5, 0.6, 1.0, 1.0); scoreDistributionMap.put(termId, new ObjectScoreDistribution(termId, 2, 3, sortedMap)); ScoreDistribution objScoreDistribution = new ScoreDistribution(2, scoreDistributionMap); Assertions.assertDoesNotThrow(() -> dbWriter.write(2, objScoreDistribution)); }
@Override public void write(int numTerms, ScoreDistribution scoreDistribution, int resolution) throws PhenolException { for (TermId objectId : scoreDistribution.getObjectIds()) { final ObjectScoreDistribution dist = scoreDistribution.getObjectScoreDistribution(objectId); writeObjectScoreDistribution(numTerms, dist, resolution); } }
H2ScoreDistributionWriter implements ScoreDistributionWriter { @Override public void write(int numTerms, ScoreDistribution scoreDistribution, int resolution) throws PhenolException { for (TermId objectId : scoreDistribution.getObjectIds()) { final ObjectScoreDistribution dist = scoreDistribution.getObjectScoreDistribution(objectId); writeObjectScoreDistribution(numTerms, dist, resolution); } } }
H2ScoreDistributionWriter implements ScoreDistributionWriter { @Override public void write(int numTerms, ScoreDistribution scoreDistribution, int resolution) throws PhenolException { for (TermId objectId : scoreDistribution.getObjectIds()) { final ObjectScoreDistribution dist = scoreDistribution.getObjectScoreDistribution(objectId); writeObjectScoreDistribution(numTerms, dist, resolution); } } H2ScoreDistributionWriter(String pathDb, String dataTableName, boolean resetTableIfExists); }
H2ScoreDistributionWriter implements ScoreDistributionWriter { @Override public void write(int numTerms, ScoreDistribution scoreDistribution, int resolution) throws PhenolException { for (TermId objectId : scoreDistribution.getObjectIds()) { final ObjectScoreDistribution dist = scoreDistribution.getObjectScoreDistribution(objectId); writeObjectScoreDistribution(numTerms, dist, resolution); } } H2ScoreDistributionWriter(String pathDb, String dataTableName, boolean resetTableIfExists); @Override void close(); @Override void write(int numTerms, ScoreDistribution scoreDistribution, int resolution); }
H2ScoreDistributionWriter implements ScoreDistributionWriter { @Override public void write(int numTerms, ScoreDistribution scoreDistribution, int resolution) throws PhenolException { for (TermId objectId : scoreDistribution.getObjectIds()) { final ObjectScoreDistribution dist = scoreDistribution.getObjectScoreDistribution(objectId); writeObjectScoreDistribution(numTerms, dist, resolution); } } H2ScoreDistributionWriter(String pathDb, String dataTableName, boolean resetTableIfExists); @Override void close(); @Override void write(int numTerms, ScoreDistribution scoreDistribution, int resolution);  }