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

com.cocoahero.android.geojson.Ring Maven / Gradle / Ivy

package com.cocoahero.android.geojson;

import org.json.JSONArray;

import android.os.Parcel;
import android.os.Parcelable;

public class Ring extends PositionList {

    // ------------------------------------------------------------------------
    // Constructors
    // ------------------------------------------------------------------------

    public Ring() {
        // Default Constructor
    }

    public Ring(JSONArray positions) {
        super(positions);
    }

    public Ring(double[][] positions) {
        super(positions);
    }

    protected Ring(Parcel parcel) {
        super(parcel);
    }

    // ------------------------------------------------------------------------
    // Parcelable Interface
    // ------------------------------------------------------------------------

    public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
        @Override
        public Ring createFromParcel(Parcel in) {
            return new Ring(in);
        }

        @Override
        public Ring[] newArray(int size) {
            return new Ring[size];
        }
    };

    // ------------------------------------------------------------------------
    // Public Methods
    // ------------------------------------------------------------------------

    public void close() {
        if (!this.isLinearRing()) {
            this.addPosition(this.getHead());
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy