SHARE
TWEET

Untitled

advictoriam Mar 4th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class LabeledPoint
  2. {
  3.    private double x;
  4.    private double y;
  5.    private String label;
  6.  
  7.    /**
  8.       Constructs a labeled point with a given position and label.
  9.       @param anX the x-coordinate of the point
  10.       @param aY the y-coordinate of the point
  11.       @param aLabel the label of the point
  12.    */
  13.    public LabeledPoint(double anX, double aY, String aLabel)
  14.    {
  15.       x = anX;
  16.       y = aY;
  17.       label = aLabel;
  18.    }
  19.  
  20.    public boolean equals(LabeledPoint p)
  21.    {
  22.       return p.x == x && p.y == y && p.label.equals(label);
  23.    }
  24.  
  25.    public static boolean check(double x1, double y1, String s1, double x2, double y2, String s2)
  26.    {
  27.       LabeledPoint lp1 = new LabeledPoint(x1, y1, s1);
  28.       LabeledPoint lp2 = new LabeledPoint(x2, y2, s2);
  29.       return lp1.equals(lp2);
  30.    }
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top