Android Open Source - zmap Point Collection






From Project

Back to project page zmap.

License

The source code is released under:

GNU Lesser General Public License

If you think the Android project zmap listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.zmap.geom;
/* w  w w  .  j a  va2s  .  c  om*/
import java.util.ArrayList;

class PointCollection implements IPointCollection, IPointCollectionEdit
{
    PointCollection()
    {
        points = new ArrayList<IPoint>();
        isEditing = false;
    }

    public int pointCount()
    {
        return points.size();
    }

    public IPoint getPoint(int i)
    {
        return points.get(i);
    }

    public void addPoint(IPoint point)
    {
        if(!isEditing)
        {
            throw new UnsupportedOperationException();
        }
        points.add(point);
    }

    public void insertPoint(IPoint point, int pos)
    {
        if(!isEditing)
        {
            throw new UnsupportedOperationException();
        }
        points.add(pos, point);
    }

    public void removePoint(int pos)
    {
        if(!isEditing)
        {
            throw new UnsupportedOperationException();
        }
        points.remove(pos);
    }

    public void beginEdit()
    {
        isEditing = true;
    }

    public void endEdit()
    {
        if(!isEditing)
        {
            throw new UnsupportedOperationException();
        }
        update();
        isEditing = false;
    }

    protected void update()
    {

    }

    protected ArrayList<IPoint> points;

    protected boolean isEditing;
}




Java Source Code List

com.zmap.MainActivity.java
com.zmap.geom.EmptyGeometryException.java
com.zmap.geom.Envelope.java
com.zmap.geom.GeometryUtil.java
com.zmap.geom.IEnvelope.java
com.zmap.geom.IGeomCollection.java
com.zmap.geom.IGeomObject.java
com.zmap.geom.ILineOperator.java
com.zmap.geom.IPointCollectionEdit.java
com.zmap.geom.IPointCollection.java
com.zmap.geom.IPoint.java
com.zmap.geom.IPolygon.java
com.zmap.geom.IPolyline.java
com.zmap.geom.IRingCollection.java
com.zmap.geom.IRing.java
com.zmap.geom.IVector.java
com.zmap.geom.InvalidGeometryException.java
com.zmap.geom.PointCollection.java
com.zmap.geom.Point.java
com.zmap.geom.Polyline.java
com.zmap.geom.Ring.java
com.zmap.geom.Vector.java