JIndividuList.tex 720 B

1234567891011121314151617181920212223242526
  1. static class JIndividuList { }
  2. static class JconcJIndividu extends JIndividuList {
  3. public JIndividu head;
  4. public JIndividuList tail;
  5. public JconcJIndividu() { head = null; tail = null; }
  6. public JconcJIndividu(JIndividu h, JIndividuList ntail) {
  7. head = h;
  8. tail = ntail;
  9. }
  10. public boolean isEmpty() {
  11. return (head == null && tail == null);
  12. }
  13. public boolean equals(Object o) {
  14. if (o instanceof JconcJIndividu) {
  15. JconcJIndividu obj = (JconcJIndividu) o;
  16. if (this.isEmpty() && obj.isEmpty()) {
  17. return true;
  18. } else if (!this.isEmpty() && !obj.isEmpty()) {
  19. return
  20. head.equals(obj.head) && tail.equals(obj.tail);
  21. }
  22. }
  23. return false;
  24. }
  25. }