Subversion Repositories Code-Repo

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed


// Specific implementation of CityRecord that stores coordinates and a city name
public class CityRecord implements Record {
        private String name;    // City name
        private int x;                  // X-coordinate
        private int y;                  // Y-coordinate
        
        // Constructor initializing a new CityRecord
        public CityRecord(String name, int x, int y) {
                this.x = x;
                this.y = y;
                this.name = name;
        }
        
        // Encapsulation methods
        public String getName() {
                return name;
        }
        public int getX() {
                return x;
        }
        public int getY() {
                return y;
        }
}