Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public boolean equals(Object obj)
- {
- // check for reference equality
- if(this == obj) return true;
- // type check
- if( !(obj instanceof Vertex2D) ) return false;
- // cast to correct type
- Vertex2D point = (Vertex2D)obj;
- if(point == null) return false;
- return ( Math.abs(this.x-point.getX()) < 0.001 && Math.abs(this.y-point.getY()) < 0.001);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement