Class ZoneImpl

  • All Implemented Interfaces:
    Zone

    public class ZoneImpl
    extends Object
    implements Zone
    Represents a demand generating zone in the network.
    Author:
    markr
    • Field Detail

      • id

        protected final long id
        Unique identifier for the zone
      • externalId

        protected final Object externalId
        External Id for this zone
      • inputProperties

        protected Map<String,​Object> inputProperties
        generic input property storage
      • centroid

        protected Centroid centroid
        Centroid of the zone
    • Constructor Detail

      • ZoneImpl

        public ZoneImpl​(IdGroupingToken groupId,
                        Object externalId,
                        Centroid centroid)
        Constructor
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
        externalId - the external ID of this zone
        centroid - of the zone
      • ZoneImpl

        public ZoneImpl​(IdGroupingToken groupId,
                        Object externalId)
        Constructor
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
        externalId - the external ID of this zone
    • Method Detail

      • generateZoneId

        protected static int generateZoneId​(IdGroupingToken groupId)
        Generate unique id for this zone
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
        Returns:
        id for this zone
      • getId

        public long getId()
        Returns the id of this zone
        Specified by:
        getId in interface Zone
        Returns:
        id of this zone
      • addInputProperty

        public void addInputProperty​(String key,
                                     Object value)
        Add a property from the original input that is not part of the readily available members
        Parameters:
        key - property key
        value - property value
      • getInputProperty

        public Object getInputProperty​(String key)
        Get input property by its key
        Parameters:
        key - property key
        Returns:
        property value
      • getCentroid

        public Centroid getCentroid()
        Returns the centroid of this zone
        Specified by:
        getCentroid in interface Zone
        Returns:
        centroid of this zone
      • setCentroid

        public void setCentroid​(Centroid centroid)
        Set the centroid of this zone
        Parameters:
        centroid - centroid for this zone
      • getExternalId

        public Object getExternalId()
        Description copied from interface: Zone
        Returns the external id of this zone
        Specified by:
        getExternalId in interface Zone
        Returns:
        the external id
      • hasExternalId

        public boolean hasExternalId()
        Description copied from interface: Zone
        Returns whether this zone has its external Id set
        Specified by:
        hasExternalId in interface Zone
        Returns:
        true if the external id has been set, false otherwise