Class PackWriter.DepthAwareVisitationPolicy

  • All Implemented Interfaces:
    ObjectWalk.VisitationPolicy
    Enclosing class:
    PackWriter

    private static class PackWriter.DepthAwareVisitationPolicy
    extends java.lang.Object
    implements ObjectWalk.VisitationPolicy
    A visitation policy which uses the depth at which the object is seen to decide if re-traversal is necessary. In particular, if the object has already been visited at this depth or shallower, it is not necessary to re-visit at this depth.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean shouldVisit​(RevObject o)
      Whenever the rev or object walk reaches a Git object, if that object already exists as a RevObject, this method is called to determine if that object should be visited.
      void visited​(RevObject o)
      Called when an object is visited.
      • Methods inherited from class java.lang.Object

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

      • lowestDepthVisited

        private final java.util.Map<ObjectId,​java.lang.Integer> lowestDepthVisited
    • Constructor Detail

      • DepthAwareVisitationPolicy

        DepthAwareVisitationPolicy​(ObjectWalk walk)
    • Method Detail

      • shouldVisit

        public boolean shouldVisit​(RevObject o)
        Description copied from interface: ObjectWalk.VisitationPolicy
        Whenever the rev or object walk reaches a Git object, if that object already exists as a RevObject, this method is called to determine if that object should be visited.
        Specified by:
        shouldVisit in interface ObjectWalk.VisitationPolicy
        Parameters:
        o - the object to check if it should be visited
        Returns:
        true if the object should be visited