Class RegionContract


  • public class RegionContract
    extends Contract
    class containing all information regarding only region-contracts
    Author:
    Klara Schöbel
    • Constructor Summary

      Constructors 
      Constructor Description
      RegionContract​(java.lang.String id, int val, Region region)
      Constructs a contract with an id, a value and the region
    • Constructor Detail

      • RegionContract

        public RegionContract​(java.lang.String id,
                              int val,
                              Region region)
        Constructs a contract with an id, a value and the region
        Parameters:
        id - id of the contract
        val - value of the contract
        region - region of the contract (see also getRegion())
    • Method Detail

      • getRegion

        public Region getRegion()
        getter for Region
        Returns:
        region this contract specifies
      • hashCode

        public int hashCode()
        override for the hashCode() method of java.lang.Object
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        name of the region
      • equals

        public boolean equals​(java.lang.Object o)
        Checks if a RegionContract and any object are equal.

        They are only equal if the other object is a RegionContract covering the same region. This is done by comparing the names of the regions.

        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - The other object to be compared to
        Returns:
        Whether both are equal