Class PlotCommit<L extends PlotLane>

Type Parameters:
L - type of lane being used by the plotter.
All Implemented Interfaces:
Serializable, Comparable<AnyObjectId>

public class PlotCommit<L extends PlotLane> extends RevCommit
A commit reference to a commit in the DAG.
See Also:
  • Field Details

  • Constructor Details

    • PlotCommit

      protected PlotCommit(AnyObjectId id)
      Create a new commit.
      Parameters:
      id - the identity of this commit.
  • Method Details

    • addForkingOffLane

      void addForkingOffLane(PlotLane f)
    • addPassingLane

      void addPassingLane(PlotLane c)
    • addMergingLane

      void addMergingLane(PlotLane m)
    • addLane

      private static PlotLane[] addLane(PlotLane l, PlotLane[] lanes)
    • addChild

      void addChild(PlotCommit c)
    • getChildCount

      public final int getChildCount()
      Get the number of child commits listed in this commit.
      Returns:
      number of children; always a positive value but can be 0.
    • getChild

      public final PlotCommit getChild(int nth)
      Get the nth child from this commit's child list.
      Parameters:
      nth - child index to obtain. Must be in the range 0 through getChildCount()-1.
      Returns:
      the specified child.
      Throws:
      ArrayIndexOutOfBoundsException - an invalid child index was specified.
    • isChild

      public final boolean isChild(PlotCommit c)
      Determine if the given commit is a child (descendant) of this commit.
      Parameters:
      c - the commit to test.
      Returns:
      true if the given commit built on top of this commit.
    • getRefCount

      public final int getRefCount()
      Get the number of refs for this commit.
      Returns:
      number of refs; always a positive value but can be 0.
    • getRef

      public final Ref getRef(int nth)
      Get the nth Ref from this commit's ref list.
      Parameters:
      nth - ref index to obtain. Must be in the range 0 through getRefCount()-1.
      Returns:
      the specified ref.
      Throws:
      ArrayIndexOutOfBoundsException - an invalid ref index was specified.
    • getLane

      public final L getLane()
      Obtain the lane this commit has been plotted into.
      Returns:
      the assigned lane for this commit.
    • reset

      public void reset()
      Reset this commit to allow another RevWalk with the same instances.

      Subclasses must call super.reset() to ensure the basic information can be correctly cleared out.

      Overrides:
      reset in class RevCommit