Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing @Override annotations #1014

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ public static Geometry bufferEach(Geometry g, final double distance)
{
return GeometryMapper.map(g, new MapOp() {

@Override
public Geometry map(Geometry g)
{
return g.buffer(distance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public static Geometry getPolygonHoles(Geometry geom)
final List holePolys = new ArrayList();
geom.apply(new GeometryFilter() {

@Override
public void filter(Geometry geom) {
if (geom instanceof Polygon) {
Polygon poly = (Polygon) geom;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public static Geometry union(Geometry a,
public static Geometry unaryUnion(Geometry a) {
UnionStrategy unionSRFun = new UnionStrategy() {

@Override
public Geometry union(Geometry g0, Geometry g1) {
return OverlayNG.overlay(g0, g1, UNION );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public static Geometry symDifference(Geometry a, Geometry b) {
public static Geometry unaryUnion(Geometry a) {
UnionStrategy unionSRFun = new UnionStrategy() {

@Override
public Geometry union(Geometry g0, Geometry g1) {
return overlay(g0, g1, UNION );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ private static Noder getNoder(double tolerance) {
public static Geometry unaryUnion(Geometry a, double tolerance) {
UnionStrategy unionSRFun = new UnionStrategy() {

@Override
public Geometry union(Geometry g0, Geometry g1) {
return OverlayNGSnappingFunctions.union(g0, g1, tolerance );
}
Expand All @@ -69,6 +70,7 @@ private static Geometry unionNoValid(Geometry a, Geometry b, double tolerance) {
public static Geometry unaryUnionNoValid(Geometry a, double tolerance) {
UnionStrategy unionSRFun = new UnionStrategy() {

@Override
public Geometry union(Geometry g0, Geometry g1) {
return OverlayNGSnappingFunctions.unionNoValid(g0, g1, tolerance );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class OverlayNoSnapFunctions {
public static Geometry unaryUnion(Geometry a) {
UnionStrategy unionSRFun = new UnionStrategy() {

@Override
public Geometry union(Geometry g0, Geometry g1) {
return OverlayOp.overlayOp(g0, g1, OverlayOp.UNION );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public static Geometry overlaySR(Geometry g1, Geometry g2,
{
PrecisionModel pm = new PrecisionModel(scale);
return computeOverlay(g1, g2, new Noder() {
@Override
public Geometry node(Geometry inputLines) {
return OverlayNG.overlay(inputLines, null, OverlayNG.UNION, pm);
}
Expand All @@ -48,6 +49,7 @@ public Geometry node(Geometry inputLines) {
public static Geometry overlay(Geometry g1, Geometry g2)
{
return computeOverlay(g1, g2, new Noder( ) {
@Override
public Geometry node(Geometry inputLines) {
return OverlayNGRobust.overlay(inputLines, null, OverlayNG.UNION);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class SelectionFunctions
public static Geometry intersects(Geometry a, final Geometry mask)
{
return select(a, new GeometryPredicate() {
@Override
public boolean isTrue(Geometry g) {
return mask.intersects(g);
}
Expand All @@ -34,6 +35,7 @@ public boolean isTrue(Geometry g) {
public static Geometry covers(Geometry a, final Geometry mask)
{
return select(a, new GeometryPredicate() {
@Override
public boolean isTrue(Geometry g) {
return g.covers(mask);
}
Expand All @@ -43,6 +45,7 @@ public boolean isTrue(Geometry g) {
public static Geometry coveredBy(Geometry a, final Geometry mask)
{
return select(a, new GeometryPredicate() {
@Override
public boolean isTrue(Geometry g) {
return g.coveredBy(mask);
}
Expand Down Expand Up @@ -85,6 +88,7 @@ public static Geometry invalid(Geometry a)
public static Geometry lengthGreaterThan(Geometry a, final double minLen)
{
return select(a, new GeometryPredicate() {
@Override
public boolean isTrue(Geometry g) {
return g.getLength() > minLen;
}
Expand All @@ -93,6 +97,7 @@ public boolean isTrue(Geometry g) {
public static Geometry lengthLessThan(Geometry a, final double maxLen)
{
return select(a, new GeometryPredicate() {
@Override
public boolean isTrue(Geometry g) {
return g.getLength() < maxLen;
}
Expand All @@ -101,6 +106,7 @@ public boolean isTrue(Geometry g) {
public static Geometry lengthZero(Geometry a)
{
return select(a, new GeometryPredicate() {
@Override
public boolean isTrue(Geometry g) {
return g.getLength() == 0.0;
}
Expand All @@ -109,6 +115,7 @@ public boolean isTrue(Geometry g) {
public static Geometry areaGreaterThan(Geometry a, final double minArea)
{
return select(a, new GeometryPredicate() {
@Override
public boolean isTrue(Geometry g) {
return g.getArea() > minArea;
}
Expand All @@ -117,6 +124,7 @@ public boolean isTrue(Geometry g) {
public static Geometry areaLessThan(Geometry a, final double maxArea)
{
return select(a, new GeometryPredicate() {
@Override
public boolean isTrue(Geometry g) {
return g.getArea() < maxArea;
}
Expand All @@ -125,6 +133,7 @@ public boolean isTrue(Geometry g) {
public static Geometry areaZero(Geometry a)
{
return select(a, new GeometryPredicate() {
@Override
public boolean isTrue(Geometry g) {
return g.getArea() == 0.0;
}
Expand All @@ -133,6 +142,7 @@ public boolean isTrue(Geometry g) {
public static Geometry within(Geometry a, final Geometry mask)
{
return select(a, new GeometryPredicate() {
@Override
public boolean isTrue(Geometry g) {
return g.within(mask);
}
Expand All @@ -142,6 +152,7 @@ public boolean isTrue(Geometry g) {
public static Geometry interiorPointWithin(Geometry a, final Geometry mask)
{
return select(a, new GeometryPredicate() {
@Override
public boolean isTrue(Geometry g) {
return g.getInteriorPoint().within(mask);
}
Expand All @@ -151,6 +162,7 @@ public boolean isTrue(Geometry g) {
public static Geometry withinDistance(Geometry a, final Geometry mask, double maximumDistance)
{
return select(a, new GeometryPredicate() {
@Override
public boolean isTrue(Geometry g) {
return mask.isWithinDistance(g, maximumDistance);
}
Expand All @@ -161,6 +173,7 @@ public static Geometry withinDistanceIndexed(Geometry a, final Geometry mask, do
{
IndexedFacetDistance indexedDist = new IndexedFacetDistance(mask);
return select(a, new GeometryPredicate() {
@Override
public boolean isTrue(Geometry g) {
boolean isWithinDist = indexedDist.isWithinDistance(g, maximumDistance);
return isWithinDist;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ public static Geometry hprTreeQueryCached(Geometry geoms, Geometry queryEnv)
private static void loadIndex(Geometry geom, SpatialIndex index) {
geom.apply(new GeometryFilter() {

@Override
public void filter(Geometry geom) {
// only insert atomic geometries
if (geom instanceof GeometryCollection) return;
Expand Down Expand Up @@ -360,6 +361,7 @@ private static Quadtree buildQuadtree(Geometry geom) {
final Quadtree index = new Quadtree();
geom.apply(new GeometryFilter() {

@Override
public void filter(Geometry geom) {
// only insert atomic geometries
if (geom instanceof GeometryCollection) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public static Geometry centroid(Geometry g)
{
return GeometryMapper.map(g,
new GeometryMapper.MapOp() {
@Override
public Geometry map(Geometry g) {
Coordinate[] pts = trianglePts(g);
Coordinate cc = Triangle.centroid(pts[0], pts[1], pts[2]);
Expand All @@ -38,6 +39,7 @@ public static Geometry circumcentre(Geometry g)
{
return GeometryMapper.map(g,
new GeometryMapper.MapOp() {
@Override
public Geometry map(Geometry g) {
Coordinate[] pts = trianglePts(g);
Coordinate cc = Triangle.circumcentre(pts[0], pts[1], pts[2]);
Expand Down Expand Up @@ -65,6 +67,7 @@ public static Geometry circumcentreDD(Geometry g)
{
return GeometryMapper.map(g,
new GeometryMapper.MapOp() {
@Override
public Geometry map(Geometry g) {
Coordinate[] pts = trianglePts(g);
Coordinate cc = Triangle.circumcentreDD(pts[0], pts[1], pts[2]);
Expand Down Expand Up @@ -92,6 +95,7 @@ public static Geometry incentre(Geometry g)
{
return GeometryMapper.map(g,
new GeometryMapper.MapOp() {
@Override
public Geometry map(Geometry g) {
Coordinate[] pts = trianglePts(g);
Coordinate cc = Triangle.inCentre(pts[0], pts[1], pts[2]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,25 @@ public BaseGeometryFunction(
this.returnType = returnType;
}

@Override
public String getCategory()
{
return category;
}

@Override
public String getName()
{
return name;
}

@Override
public String getDescription()
{
return description;
}

@Override
public String[] getParameterNames()
{
return parameterNames;
Expand All @@ -109,24 +113,29 @@ public String[] getParameterNames()
*
* @return the types
*/
@Override
public Class[] getParameterTypes()
{
return parameterTypes;
}

@Override
public Class getReturnType()
{
return returnType;
}

@Override
public boolean isBinary() {
return parameterTypes.length > 0 && parameterTypes[0] == Geometry.class;
}

@Override
public boolean isRequiredB() {
return isRequiredB;
}

@Override
public String getSignature()
{
StringBuffer paramTypes = new StringBuffer();
Expand Down Expand Up @@ -154,6 +163,7 @@ protected static Integer getIntegerOrNull(Object[] args, int index)
return (Integer) args[index];
}

@Override
public abstract Object invoke(Geometry geom, Object[] args);

/**
Expand Down Expand Up @@ -193,6 +203,7 @@ public int hashCode() {
return result;
}

@Override
public int compareTo(Object o)
{
GeometryFunction func = (GeometryFunction) o;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,38 +38,47 @@ public FilterGeometryFunction(GeometryFunction fun, int op, double val) {
this.filterVal = val;
}

@Override
public String getCategory() {
return fun.getCategory();
}

@Override
public String getName() {
return fun.getName() + "?";
}

@Override
public String getDescription() {
return fun.getDescription();
}

@Override
public String[] getParameterNames() {
return fun.getParameterNames();
}

@Override
public Class[] getParameterTypes() {
return fun.getParameterTypes();
}

@Override
public Class getReturnType() {
return Geometry.class;
}

@Override
public String getSignature() {
return fun.getSignature();
}

@Override
public boolean isBinary() {
return fun.isBinary();
}

@Override
public boolean isRequiredB() {
return fun.isRequiredB();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,30 +40,37 @@ public RepeaterGeometryFunction(GeometryFunction fun, int count) {
hasRepeatableArg = hasRepeatableArg(fun);
}

@Override
public String getCategory() {
return fun.getCategory();
}

@Override
public String getName() {
return fun.getName() + repeatAnnotation();
}

@Override
public String getDescription() {
return fun.getDescription();
}

@Override
public String[] getParameterNames() {
return fun.getParameterNames();
}

@Override
public Class<?>[] getParameterTypes() {
return fun.getParameterTypes();
}

@Override
public Class<?> getReturnType() {
return fun.getReturnType();
}

@Override
public String getSignature() {
return fun.getSignature();
}
Expand All @@ -72,14 +79,17 @@ private String repeatAnnotation() {
return "*" + count;
}

@Override
public boolean isBinary() {
return fun.isBinary();
}

@Override
public boolean isRequiredB() {
return fun.isRequiredB();
}

@Override
public Object invoke(Geometry geom, Object[] args) {

if (! isRepeatable(fun)) {
Expand Down
Loading
Loading