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

com.github.martinfrank.drawlib.Points Maven / Gradle / Ivy

The newest version!
package com.github.martinfrank.drawlib;

import java.util.HashMap;

public class Points {

    private java.util.Map internalPointsRepresentation = new HashMap<>();

    public Point get(Point point) {
        Point p = internalPointsRepresentation.get(point.hashCode());
        if (p == null) {
            internalPointsRepresentation.put(point.hashCode(), point);
            return point;
        }
        return p;
    }

    public int size() {
        return internalPointsRepresentation.size();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy