Revision 26289 branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/primitive/Point2D.java

View differences:

Point2D.java
351 351
		// TODO Auto-generated method stub
352 352
		return null;
353 353
	}
354
	
354

  
355 355
	public DirectPosition getDirectPosition() {
356 356
		return this;
357 357
	}
358
	
358

  
359 359
	public int getDimensions() {
360 360
		return getCoordinateDimension();
361 361
	}
362
	
362

  
363 363
	public double getOrdinate(int dim) {
364
		if (dim == 0) return getX();
365
		else if (dim == 1) return getY();
366
		else return 0;
364
		if (dim == 0) {
365
			return getX();
366
		} else if (dim == 1) {
367
			return getY();
368
		} else {
369
			return 0;
370
		}
367 371
	}
372

  
373
	public boolean equals(Object other) {
374
		if (!super.equals(other)) {
375
			return false;
376
		}
377
		Point2D pother = (Point2D) other;
378
		if (Math.abs(this.getX() - pother.getX()) > 0.0000001) {
379
			return false;
380
		}
381
		if (Math.abs(this.getY() - pother.getY()) > 0.0000001) {
382
			return false;
383
		}
384
		return true;
385

  
386
	}
368 387
}

Also available in: Unified diff