Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. public ZbiorPunktow(){
  2.  
  3. }
  4.  
  5. public LepszyPunkt najbardziejOdlegly(){
  6. LepszyPunkt p=new LepszyPunkt();
  7. Iterator <LepszyPunkt> it= this.iterator();
  8. while(this.iterator().hasNext()!=false){
  9.  
  10. LepszyPunkt odlegly=it.next();
  11. if(odlegly.odleglosc()>p.odleglosc()){
  12. p=odlegly;
  13. }
  14. }
  15. return p;
  16. }
  17.  
  18. public LepszyPunkt najblizszy(){
  19. LepszyPunkt p=this.najbardziejOdlegly();
  20. Iterator <LepszyPunkt> it= this.iterator();
  21. while(this.iterator().hasNext()){
  22.  
  23. LepszyPunkt najblizszy=it.next();
  24. if(najblizszy.odleglosc()<p.odleglosc()){
  25. p=najblizszy;
  26. }
  27. }
  28. return p;
  29. }
  30.  
  31. public double maksymalnaOdleglosc(){
  32. return this.najbardziejOdlegly().odleglosc()-this.najblizszy().odleglosc();
  33. }
  34.  
  35. public double minimalnaOdleglosc(){
  36. double m=this.minimalnaOdleglosc();
  37. LepszyPunkt p=new LepszyPunkt();
  38. Iterator <LepszyPunkt> it= this.iterator();
  39.  
  40. while(it.hasNext()){
  41. Iterator <LepszyPunkt> itt= this.iterator();
  42. while(itt.hasNext() ){
  43.  
  44.  
  45. }
  46. }
  47. return m;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement