PriorityCount.java 652 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package holeg.ui.model;
  2. import holeg.model.HolonElement;
  3. import jdk.jfr.Unsigned;
  4. public class PriorityCount {
  5. @Unsigned
  6. public int low, medium, high, essential;
  7. public void add(PriorityCount other) {
  8. low += other.low;
  9. medium += other.medium;
  10. high += other.high;
  11. essential += other.essential;
  12. }
  13. public void count(HolonElement element) {
  14. switch (element.getPriority()) {
  15. case Essential:
  16. essential++;
  17. break;
  18. case High:
  19. high++;
  20. break;
  21. case Medium:
  22. medium++;
  23. break;
  24. case Low:
  25. low++;
  26. break;
  27. default:
  28. break;
  29. }
  30. }
  31. }