Subversion Repositories Code-Repo

Compare Revisions

Ignore whitespace Rev 104 → Rev 105

/Classwork/CS3114 - Data Algorithms/Project 4/CityRecord.java
0,0 → 1,25
 
// 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;
}
}