Package statistics

Source Code of statistics.Point

package statistics;

import java.awt.Color;

import lipstone.joshua.parser.types.BigDec;

public class Point {
  public BigDec x;
  public BigDec y;
  public int diameter;
  public String set;
  protected Color color;
 
  public Point(){
    x = BigDec.ZERO;
    y = BigDec.ZERO;
    diameter = 8;
    set = "";
    color = Color.BLACK;
  }
  public Point(BigDec x, BigDec y, String set){
    super();
    this.x = x;
    this.y = y;
    this.set = set;
    color = Color.BLACK;
  }
  public Point(BigDec x, BigDec y, String set, Color color){
    this.x = x;
    this.y = y;
    this.set = set;
    this.color = color;
  }
  public Point(BigDec x, BigDec y, String set, Color color, int diameter){
    this.x = x;
    this.y = y;
    this.set = set;
    this.color = color;
    this.diameter = diameter;
  }
  public Point(Point p){
    this.x = p.x;
    this.y = p.y;
    this.set = p.set;
    this.color = p.color;
    this.diameter = p.diameter;
  }
 
  public BigDec[] getPosition(){
    BigDec output[] = {BigDec.ZERO, BigDec.ZERO};
    output[0] = x;
    output[1] = y;
    return output;
  }
 
  public void setPosition(BigDec x, BigDec y){
    this.x = x;
    this.y = y;
  }
  public void setPosition(BigDec pos[]){
    this.x = pos[0];
    this.y = pos[1];
  }
 
  /**
   * @return a <tt>String</tt> generated by:
   *         <code>"x = " + x + ", y = " + y + ", set = " + set + ", color = " + color.toString();</code>
   */
  @Override
  public String toString(){
    return "x = " + x + ", y = " + y + ", set = " + set + ", color = " + color.toString();
  }
  public Color getColor(){return color;}
  public void setColor(Color color){this.color = color;}
}
TOP

Related Classes of statistics.Point

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.