Esempio n. 1
0
  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);
  }
Esempio n. 2
0
 /**
  * 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);
 }