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

org.geojson.FeatureCollection Maven / Gradle / Ivy

Go to download

A collection of Java POJOs for GeoJson (fork from https://github.com/opendatalab-de/geojson-jackson)

The newest version!
package org.geojson;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;

public class FeatureCollection extends GeoJsonObject implements Iterable {

	private List features = new ArrayList();

	public List getFeatures() {
		return features;
	}

	public void setFeatures(List features) {
		this.features = features;
	}

	public FeatureCollection add(Feature feature) {
		features.add(feature);
		return this;
	}

	public void addAll(Collection features) {
		this.features.addAll(features);
	}

	@Override
	public Iterator iterator() {
		return features.iterator();
	}

	@Override
	public  T accept(GeoJsonObjectVisitor geoJsonObjectVisitor) {
		return geoJsonObjectVisitor.visit(this);
	}

	@Override
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (!(o instanceof FeatureCollection))
			return false;
		FeatureCollection features1 = (FeatureCollection)o;
		return features.equals(features1.features);
	}

	@Override
	public int hashCode() {
		return features.hashCode();
	}

	@Override
	public String toString() {
		return "FeatureCollection{" + "features=" + features + '}';
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy