Class AbstractPathDetailsBuilder

java.lang.Object
com.graphhopper.util.details.AbstractPathDetailsBuilder
All Implemented Interfaces:
PathDetailsBuilder
Direct Known Subclasses:
AverageSpeedDetails, BooleanDetails, ConstantDetailsBuilder, DecimalDetails, DistanceDetails, EdgeIdDetails, EdgeKeyDetails, EnumDetails, IntDetails, IntersectionDetails, KVStringDetails, StringDetails, TimeDetails, WeightDetails

public abstract class AbstractPathDetailsBuilder extends Object implements PathDetailsBuilder
Builds a PathDetail list, from values and intervals of a Path.
Author:
Robin Boldt
  • Constructor Details

    • AbstractPathDetailsBuilder

      public AbstractPathDetailsBuilder(String name)
  • Method Details

    • getCurrentValue

      protected abstract Object getCurrentValue()
      The value of the Path at this moment, that should be stored in the PathDetail when calling startInterval
    • startInterval

      public void startInterval(int firstIndex)
      It is only possible to open one interval at a time. Calling startInterval when the interval is already open results in an Exception.
      Specified by:
      startInterval in interface PathDetailsBuilder
      Parameters:
      firstIndex - the index the PathDetail starts
    • endInterval

      public void endInterval(int lastIndex)
      Ending intervals multiple times is safe, we only write the interval if it was open and not empty. Writes the interval to the pathDetails
      Specified by:
      endInterval in interface PathDetailsBuilder
      Parameters:
      lastIndex - the index the PathDetail ends
    • build

      public Map.Entry<String,List<PathDetail>> build()
      Specified by:
      build in interface PathDetailsBuilder
    • getName

      public String getName()
      Specified by:
      getName in interface PathDetailsBuilder
    • toString

      public String toString()
      Overrides:
      toString in class Object