Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Mavo2020.Playground;
- /**
- * Represent a single Node in the polygon list
- */
- public class PointNode {
- private Point _point;
- private PointNode _next;
- public PointNode(Point p) {
- this._point = new Point(p);
- this._next = null;
- }
- public PointNode(Point p, PointNode n) {
- this._point = new Point(p);
- this._next = n;
- }
- public PointNode(PointNode p) {
- this._point = p.getPoint(); //no aliasing because getPoint returns a copy
- this._next = p.getNext();
- }
- public Point getPoint() {
- return new Point(this._point);
- }
- public PointNode getNext() {
- return _next;
- }
- public void setPoint(Point p) {
- this._point = new Point(p);
- }
- public void setNext(PointNode next) {
- this._next = next;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement