/* I represent a waterway, e.g. a river, creak, or a stream * En Å, bæk eller grøft */ public class WaterWay { private String name; private double length; // - in kilometers private WaterSource source; private WaterWay[] tributaries = new WaterWay[20]; // Max 20 tributaries private int numberOfTributaries = 0; public WaterWay(String name, double length, WaterSource source){ this.name = name; this.length = length; this.source = source; } /* accessor */ public int getNumberOfTributaries(){ return numberOfTributaries; } /* indexed accessor */ public WaterWay getTributary(int index){ return tributaries[index]; } /* accessor */ public WaterSource getSource(){ return source; } /* Add a tributary to this waterway. A max of 20 can be added */ public void addTributary(WaterWay ww){ tributaries[numberOfTributaries] = ww; numberOfTributaries++; } /* Return the total length og this waterway and all its tributaries */ public double totalLength(){ double totalLength = this.length; for (int index = 0; index