Subversion Repositories Code-Repo

Rev

Rev 94 | Blame | Compare with Previous | 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;
        }
}