Class PackWriter.DepthAwareVisitationPolicy
- java.lang.Object
-
- org.eclipse.jgit.internal.storage.pack.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.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<ObjectId,java.lang.Integer>
lowestDepthVisited
private ObjectWalk
walk
-
Constructor Summary
Constructors Constructor Description DepthAwareVisitationPolicy(ObjectWalk walk)
-
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.
-
-
-
Field Detail
-
lowestDepthVisited
private final java.util.Map<ObjectId,java.lang.Integer> lowestDepthVisited
-
walk
private final ObjectWalk walk
-
-
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 interfaceObjectWalk.VisitationPolicy
- Parameters:
o
- the object to check if it should be visited- Returns:
- true if the object should be visited
-
visited
public void visited(RevObject o)
Description copied from interface:ObjectWalk.VisitationPolicy
Called when an object is visited.- Specified by:
visited
in interfaceObjectWalk.VisitationPolicy
- Parameters:
o
- the object that was visited
-
-