import java.util.ArrayList; public class Line { private static int id = 1; private int idLine; private LineColor color; private ArrayList stations; private static int counter = 0; public Line() { this.idLine = id++; switch(counter++){ case 0 -> { this.color = LineColor.YELLOW; } case 1 -> { this.color = LineColor.GREEN; } case 2 -> { this.color = LineColor.BLUE; } case 3 -> { this.color = LineColor.RED; } case 4 -> { this.color = LineColor.ORANGE; } } this.stations = new ArrayList<>(); } public LineColor getColor() { return color; } public void addStation (Station station) { stations.add(station); } public int getIdLine() { return idLine; } public ArrayList getStations() { return stations; } }