Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ZbiorPunktow(){
- }
- public LepszyPunkt najbardziejOdlegly(){
- LepszyPunkt p=new LepszyPunkt();
- Iterator <LepszyPunkt> it= this.iterator();
- while(this.iterator().hasNext()!=false){
- LepszyPunkt odlegly=it.next();
- if(odlegly.odleglosc()>p.odleglosc()){
- p=odlegly;
- }
- }
- return p;
- }
- public LepszyPunkt najblizszy(){
- LepszyPunkt p=this.najbardziejOdlegly();
- Iterator <LepszyPunkt> it= this.iterator();
- while(this.iterator().hasNext()){
- LepszyPunkt najblizszy=it.next();
- if(najblizszy.odleglosc()<p.odleglosc()){
- p=najblizszy;
- }
- }
- return p;
- }
- public double maksymalnaOdleglosc(){
- return this.najbardziejOdlegly().odleglosc()-this.najblizszy().odleglosc();
- }
- public double minimalnaOdleglosc(){
- double m=this.minimalnaOdleglosc();
- LepszyPunkt p=new LepszyPunkt();
- Iterator <LepszyPunkt> it= this.iterator();
- while(it.hasNext()){
- Iterator <LepszyPunkt> itt= this.iterator();
- while(itt.hasNext() ){
- }
- }
- return m;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement