ElemCompOnIsFlexible.java 367 B

123456789101112131415161718
  1. package classes.comparator.elementComparator;
  2. import classes.HolonElement;
  3. public class ElemCompOnIsFlexible extends ElementComparator{
  4. @Override
  5. public int compare(HolonElement a, HolonElement b) {
  6. boolean ifA = a.isFlexible();
  7. boolean ifB = b.isFlexible();
  8. if (ifA&&!ifB)
  9. return -1;
  10. if (!ifA && ifB)
  11. return 1;
  12. return 0;
  13. }
  14. }