Subversion Repositories Code-Repo

Rev

Rev 96 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
96 Kevin 1
 
2
// Specific implementation of CityRecord that stores coordinates and a city name
3
public class CityRecord implements Record {
4
	private String name;	// City name
5
	private int x;			// X-coordinate
6
	private int y;			// Y-coordinate
7
 
8
	// Constructor initializing a new CityRecord
9
	public CityRecord(String name, int x, int y) {
10
		this.x = x;
11
		this.y = y;
12
		this.name = name;
13
	}
14
 
15
	// Encapsulation methods
16
	public String getName() {
17
		return name;
18
	}
19
	public int getX() {
20
		return x;
21
	}
22
	public int getY() {
23
		return y;
24
	}
25
}