Class Region


  • public class Region
    extends java.lang.Object
    Class containing all information regarding regions (acts like a struct)
    Author:
    Klara Schöbel
    • Constructor Summary

      Constructors 
      Constructor Description
      Region​(java.util.HashMap<java.lang.String,​City> cities, java.lang.String name, Border[] polygons)
      Constructs a region with cities, a name and borders
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.HashMap<java.lang.String,​City> getCities()
      getter for cities
      City getCityByName​(java.lang.String name)
      getter for a city in this region by name
      java.lang.String getName()
      getter for name
      Border[] getPolygons()
      getter for Polygons
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Region

        public Region​(java.util.HashMap<java.lang.String,​City> cities,
                      java.lang.String name,
                      Border[] polygons)
        Constructs a region with cities, a name and borders
        Parameters:
        cities - hashmap of all the cities (see also getCities())
        name - name of the region (see also getName())
        polygons - polygons representing the borders (see also getPolygons())
    • Method Detail

      • getCities

        public java.util.HashMap<java.lang.String,​City> getCities()
        getter for cities
        Returns:
        all the cities in this region as a Hashmap (hash-key of a city is the name of the city)
      • getCityByName

        public City getCityByName​(java.lang.String name)
        getter for a city in this region by name
        Parameters:
        name - Name of the city
        Returns:
        the city with the given name for or null if the city is not in this region
      • getName

        public java.lang.String getName()
        getter for name
        Returns:
        name of the city
      • getPolygons

        public Border[] getPolygons()
        getter for Polygons
        Returns:
        the bounds of this region