public static Train arrivedContainersToTrain(List<ContainerData> containers) { // Get the first container ContainerData container = containers.get(0); // Get the arrive and leave time from the container DateTime arriveTime = container.getEnterDateTimeFrom(); DateTime leaveTime = container.getEnterDateTimeTo(); // Create and return the ship return new Train(arriveTime, leaveTime, containers); }
/** * Add a container on the train * * @param container the container to add */ public void addContainer(ContainerData container) { container.setLocation(new Point3D(this._positionCounter++, 0, 0)); this._containers.add(container); }