@Override public boolean equals( final Object obj ) { return obj instanceof Polygon2D && Polyshape.equals( this, ( Polygon2D ) obj ); }
@Override public int size() { return numVertices(); } };
@Override public RealLocalizable get(int index) { return vertex(index); }
/** * Determines whether two polyshapes describe the same region. * <p> * Two polyshapes are equal iff they have the same mask type, boundary type, * dimensions and vertices. * </p> * * @param polyshape1 * The first polyshape to compare. * @param polyshape2 * The second polyshape to compare. * @return True iff the polyshapes describe the same region. */ static boolean equals( final Polyshape polyshape1, final Polyshape polyshape2 ) { if ( polyshape1 == null && polyshape2 == null ) return true; if ( polyshape1 == null || polyshape2 == null || !Masks.sameTypesAndDimensions( polyshape1, polyshape2 ) ) return false; // Ensure same vertices in same order. final List< RealLocalizable > vertices1 = polyshape1.vertices(); final List< RealLocalizable > vertices2 = polyshape2.vertices(); for ( final Pair< RealLocalizable, RealLocalizable > pair : new IterablePair<>( vertices1, vertices2 ) ) if ( !Util.locationsEqual( pair.getA(), pair.getB() ) ) return false; return true; } }
@Override public boolean equals(final Object obj) { return obj instanceof Polygon2D && Polyshape.equals(this, (Polygon2D) obj); }
@Override public boolean equals(final Object obj) { return obj instanceof Polyline && Polyshape.equals(this, (Polyline) obj); }
@Override public boolean equals(final Object obj) { return obj instanceof Polygon2D && Polyshape.equals(this, (Polygon2D) obj); }
@Override public boolean equals( final Object obj ) { return obj instanceof Polyline && Polyshape.equals( this, ( Polyline ) obj ); }
@Override public boolean equals(final Object obj) { return obj instanceof Polyline && Polyshape.equals(this, (Polyline) obj); }