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

br.com.anteros.nosql.persistence.mongodb.geo.LineString Maven / Gradle / Ivy

There is a newer version: 1.0.6
Show newest version
package br.com.anteros.nosql.persistence.mongodb.geo;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;


public class LineString implements Geometry {
    private final List coordinates;

    @SuppressWarnings("UnusedDeclaration") 
    private LineString() {
        coordinates = new ArrayList();
    }

    LineString(final Point... points) {
        this.coordinates = Arrays.asList(points);
    }

    LineString(final List points) {
        coordinates = points;
    }

    @Override
    public List getCoordinates() {
        return coordinates;
    }

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

    @Override
    public boolean equals(final Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        LineString that = (LineString) o;

        if (!coordinates.equals(that.coordinates)) {
            return false;
        }

        return true;
    }

    @Override
    public String toString() {
        return "LineString{"
               + "coordinates=" + coordinates
               + '}';
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy