Class HistoryWay

    • Field Detail

      • nodeIds

        private final java.util.List<java.lang.Long> nodeIds
    • Constructor Detail

      • HistoryWay

        public HistoryWay​(long id,
                          long version,
                          boolean visible,
                          User user,
                          long changesetId,
                          java.time.Instant timestamp)
        Constructs a new HistoryWay.
        Parameters:
        id - the id (> 0 required)
        version - the version (> 0 required)
        visible - whether the node is still visible
        user - the user (!= null required)
        changesetId - the changeset id (> 0 required if checkHistoricParams is true)
        timestamp - the timestamp (!= null required if checkHistoricParams is true)
        Throws:
        java.lang.IllegalArgumentException - if preconditions are violated
      • HistoryWay

        public HistoryWay​(long id,
                          long version,
                          boolean visible,
                          User user,
                          long changesetId,
                          java.time.Instant timestamp,
                          boolean checkHistoricParams)
        Constructs a new HistoryWay with a configurable checking of historic parameters. This is needed to build virtual HistoryWays for modified ways, which do not have a timestamp and a changeset id.
        Parameters:
        id - the id (> 0 required)
        version - the version (> 0 required)
        visible - whether the node is still visible
        user - the user (!= null required)
        changesetId - the changeset id (> 0 required if checkHistoricParams is true)
        timestamp - the timestamp (!= null required if checkHistoricParams is true)
        checkHistoricParams - if true, checks values of changesetId and timestamp
        Throws:
        java.lang.IllegalArgumentException - if preconditions are violated
        Since:
        5440
      • HistoryWay

        public HistoryWay​(long id,
                          long version,
                          boolean visible,
                          User user,
                          long changesetId,
                          java.time.Instant timestamp,
                          java.util.List<java.lang.Long> nodeIdList)
        Constructs a new HistoryWay with a given list of node ids.
        Parameters:
        id - the id (> 0 required)
        version - the version (> 0 required)
        visible - whether the node is still visible
        user - the user (!= null required)
        changesetId - the changeset id (> 0 required if checkHistoricParams is true)
        timestamp - the timestamp (!= null required if checkHistoricParams is true)
        nodeIdList - the node ids (!= null required)
        Throws:
        java.lang.IllegalArgumentException - if preconditions are violated
      • HistoryWay

        public HistoryWay​(Way w)
        Constructs a new HistoryWay from an existing Way.
        Parameters:
        w - the way
    • Method Detail

      • getNumNodes

        public int getNumNodes()
        replies the number of nodes in this way
        Returns:
        the number of nodes
      • getNodeId

        public long getNodeId​(int idx)
        replies the idx-th node id in the list of node ids of this way
        Parameters:
        idx - the index
        Returns:
        the idx-th node id
        Throws:
        java.lang.IndexOutOfBoundsException - if idx < 0 || idx >= {#see getNumNodes()
      • getNodes

        public java.util.List<java.lang.Long> getNodes()
        replies an immutable list of the ways node ids
        Returns:
        the ways node ids
      • addNode

        public void addNode​(long ref)
        adds a node id to the list nodes of this way
        Parameters:
        ref - the node id to add
      • isClosed

        public boolean isClosed()
        Replies true if this way is closed.
        Returns:
        true if this way is closed.
      • fillPrimitiveData

        public WayData fillPrimitiveData​(WayData data)
        Fills the way attributes with values from this history.
        Parameters:
        data - way data to fill
        Returns:
        filled way data
        Since:
        11878