Skip to content

Commit

Permalink
Removed all reference to coordinates ArrayList
Browse files Browse the repository at this point in the history
  • Loading branch information
bryan authored and bryan committed Sep 19, 2013
1 parent c2a195b commit b5a62ea
Showing 1 changed file with 5 additions and 23 deletions.
28 changes: 5 additions & 23 deletions Point.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,19 @@

public class Point
{
public ArrayList<Double> coordinates;
public double x,y;
public int dims;

public Point(double x, double y)
{
this.coordinates = new ArrayList<Double>();
this.x = x;
this.y = y;

coordinates.add(x);
coordinates.add(y);

dims = coordinates.size();
}

public Point(ArrayList<Double> coordinates)
{
this.coordinates = coordinates;
dims = coordinates.size();
}

public Double x()
{
return coordinates.get(0);
}

public Double y()
{
return coordinates.get(1);
dims = 2;
}

public String toString()
{
return "{" + x() + ", " + y() + "}";
return "{" + x + ", " + y + "}";
}
}

0 comments on commit b5a62ea

Please sign in to comment.