All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.maptalks.geojson.FeatureCollection Maven / Gradle / Ivy

The newest version!
package org.maptalks.geojson;

public class FeatureCollection extends GeoJSON {
    private Feature[] features;

    public FeatureCollection() {
        super();
    }

    public FeatureCollection(Feature[] features) {
        super();
        this.setFeatures(features);
    }

    public Feature[] getFeatures() {
        return features;
    }

    public void setFeatures(Feature[] features) {
        this.features = features;
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof FeatureCollection)) {
            return false;
        }
        FeatureCollection o = ((FeatureCollection) obj);
        if (this.features == null) {
            if (o.getFeatures() != null) {
                return false;
            }
        } else {
            if (o.getFeatures() == null) {
                return false;
            }
            if (this.features.length != o.getFeatures().length) {
                return false;
            }
            int size = this.features.length;
            for (int i = 0; i < size; i++) {
                if (!this.features[i].equals(o.features[i])) {
                    return false;
                }
            }
        }
        return true;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy