Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public List<Golub> findAllFinalMode() {
- final List<Golub> res = new ArrayList<Golub>();
- for (final Golub c : this.findAll())
- if (c.getFinalMode())
- res.add(c);
- return res;
- }
- public List<Golub> findAllNoFinalMode() {
- final List<Golub> res = new ArrayList<Golub>();
- for (final Golub c : this.findAll())
- if (c.getFinalMode() == false)
- res.add(c);
- return res;
- }
- public Map<String, Double> computeGolubsPerConferenceStats() {
- Map<String, Double> result;
- result = new HashMap<String, Double>();
- Double[] stats;
- if (!this.findAllFinalMode().isEmpty()) {
- stats = this.golubRepository.getGolubsPerConferenceStats();
- result.put("avg", stats[0]);
- result.put("stdev", stats[1]);
- } else {
- result.put("avg", 0.0);
- result.put("stdev", 0.0);
- }
- return result;
- }
- public Map<String, Double> ratioPublishedVersusTotalGolubs() {
- Map<String, Double> result;
- result = new HashMap<String, Double>();
- final Double publishedGolubs = (double) this.findAllFinalMode().size();
- final Double total = (double) this.findAll().size();
- final Double ratio = publishedGolubs / total;
- if (!this.findAll().isEmpty())
- result.put("ratio", ratio);
- else
- result.put("ratio", 0.0);
- return result;
- }
- public Map<String, Double> ratioUnpublishedVersusTotalGolubs() {
- Map<String, Double> result;
- result = new HashMap<String, Double>();
- final Double unpublishedGolubs = (double) this.findAllNoFinalMode().size();
- final Double total = (double) this.findAll().size();
- final Double ratio = unpublishedGolubs / total;
- if (!this.findAll().isEmpty())
- result.put("ratio", ratio);
- else
- result.put("ratio", 0.0);
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement