Class Shipyards

  • All Implemented Interfaces:
    java.lang.Iterable<java.util.Map.Entry<ICity,​IShipyard>>

    public class Shipyards
    extends java.lang.Object
    implements java.lang.Iterable<java.util.Map.Entry<ICity,​IShipyard>>
    Author:
    Andi Hotz, (c) Sahits GmbH, 2016 Created on Dec 30, 2016
    • Constructor Summary

      Constructors 
      Constructor Description
      Shipyards()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(IShipyard shipyard, ICity city)
      Add a shipyard in the city.
      IShipyard getShipyard​(ICity city)
      Retrieve the shipyard of the city.
      java.util.Iterator<java.util.Map.Entry<ICity,​IShipyard>> iterator()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • Shipyards

        public Shipyards()
    • Method Detail

      • add

        public void add​(IShipyard shipyard,
                        ICity city)
        Add a shipyard in the city.
        Parameters:
        shipyard - to be added
        city - in which to add the shipyard
      • getShipyard

        public IShipyard getShipyard​(ICity city)
        Retrieve the shipyard of the city. This method should not be called when there is no shipyard at all.
        Parameters:
        city - for which to lookup the shipyard
        Returns:
        shipyard of city
      • iterator

        public java.util.Iterator<java.util.Map.Entry<ICity,​IShipyard>> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<java.util.Map.Entry<ICity,​IShipyard>>