spot.java

来自「公交信息查询」· Java 代码 · 共 70 行

JAVA
70
字号
// Spot.java
//该类用于描述地图上的一个点,包括名称,位置两个属性
import java.awt.*;
public class Spot
  {
    String name;
    Point  location;
  public Spot ( String name, Point location )
      {
        this.name=name;
        this.location=location;
      }
   public Spot ( )
      {
        
      }


  public Spot ( Spot spot )
      {
        this.name=spot.name;
        this.location=spot.location;
      
      }
   public Spot ( String name )  
       {
           this.name=name;
       }
  
  public  Spot getspot()
      {
          return this;
      }
  public void setspot( Spot spot)
      {
         this.name=spot.name;
         this.location=spot.location;
      }
  public  String getname()
      {
          return name;
      }
  public void setname( String name )
      {
         this.name=name;
      }

  public void setlocation( Point location )
      {
         this.location=location;
      }

   public  Point getlocation()
      {
         return location;
      }
   public void show()
      {
           System.out.print( name );

      }

   public String output()
      {
           String outData;
           outData=name;
           return outData;

      }
  }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?