⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 location.java

📁 proxy server for caching and packet filtering final project
💻 JAVA
字号:
/**
 * Represents the holes on the 10 x 10 board
 */
public class Location{                      //the holes on the 10 X 10 square : row, column coordinates
  /**
   * The row coordinate
   */
  private int row;
  /**
   * The column coordinate
   */
  private int col;
  /**
   * Creates an object with specified row and column coordinates
   * @param r row
   * @param c column
   */
  Location(int r, int c){            //constructor takes the coordinates
    row=r;
    col=c;
  }
  /**
   * Default constructor
   */
  Location(){
    row=0;
    col=0;
  }
  /**
   * @return the row coordinate
   */
  public int row(){
    return row;
  }
  /**
   * @return the column coordinate
   */
  public int col(){
    return col;
  }
  /**
   * Tests if two objects refer to the same hole
   * @param l Location to compare with
   * @return true if this Location and l refer to the same hole
   */
  public boolean equal(Location l){  
    return ((row==l.row())&&(col==l.col()));
  }
};
 

⌨️ 快捷键说明

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