Class FIFORevQueue


  • public class FIFORevQueue
    extends java.lang.Object
    A queue of commits in FIFO order.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.eclipse.jgit.revwalk.BlockRevQueue.BlockFreeList free  
    • Constructor Summary

      Constructors 
      Constructor Description
      FIFORevQueue()
      Create an empty FIFO queue.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(RevCommit c)
      Add a commit to the queue.
      void add​(RevCommit c, RevFlag queueControl)
      Add a commit if it does not have a flag set yet, then set the flag.
      void addParents​(RevCommit c, RevFlag queueControl)
      Add a commit's parents if one does not have a flag set yet.
      void clear()
      Remove all entries from this queue.
      protected static void describe​(java.lang.StringBuilder s, RevCommit c)  
      RevCommit next()
      Remove the first commit from the queue.
      void shareFreeList​(org.eclipse.jgit.revwalk.BlockRevQueue q)
      Reconfigure this queue to share the same free list as another.
      java.lang.String toString()  
      void unpop​(RevCommit c)
      Insert the commit pointer at the front of the queue.
      • Methods inherited from class java.lang.Object

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

      • free

        protected org.eclipse.jgit.revwalk.BlockRevQueue.BlockFreeList free
    • Constructor Detail

      • FIFORevQueue

        public FIFORevQueue()
        Create an empty FIFO queue.
    • Method Detail

      • add

        public void add​(RevCommit c)
        Add a commit to the queue.

        This method always adds the commit, even if it is already in the queue or previously was in the queue but has already been removed. To control queue admission use add(RevCommit, RevFlag).

        Parameters:
        c - commit to add.
      • unpop

        public void unpop​(RevCommit c)
        Insert the commit pointer at the front of the queue.
        Parameters:
        c - the commit to insert into the queue.
      • next

        public RevCommit next()
        Remove the first commit from the queue.
        Returns:
        the first commit of this queue.
      • clear

        public void clear()
        Remove all entries from this queue.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • shareFreeList

        public void shareFreeList​(org.eclipse.jgit.revwalk.BlockRevQueue q)
        Reconfigure this queue to share the same free list as another.

        Multiple revision queues can be connected to the same free list, making it less expensive for applications to shuttle commits between them. This method arranges for the receiver to take from / return to the same free list as the supplied queue.

        Free lists are not thread-safe. Applications must ensure that all queues sharing the same free list are doing so from only a single thread.

        Parameters:
        q - the other queue we will steal entries from.
      • add

        public final void add​(RevCommit c,
                              RevFlag queueControl)
        Add a commit if it does not have a flag set yet, then set the flag.

        This method permits the application to test if the commit has the given flag; if it does not already have the flag than the commit is added to the queue and the flag is set. This later will prevent the commit from being added twice.

        Parameters:
        c - commit to add.
        queueControl - flag that controls admission to the queue.
      • addParents

        public final void addParents​(RevCommit c,
                                     RevFlag queueControl)
        Add a commit's parents if one does not have a flag set yet.

        This method permits the application to test if the commit has the given flag; if it does not already have the flag than the commit is added to the queue and the flag is set. This later will prevent the commit from being added twice.

        Parameters:
        c - commit whose parents should be added.
        queueControl - flag that controls admission to the queue.
      • describe

        protected static void describe​(java.lang.StringBuilder s,
                                       RevCommit c)