Class RevCommitList<E extends RevCommit>

  • Type Parameters:
    E - type of subclass of RevCommit the list is storing.
    All Implemented Interfaces:
    java.lang.Iterable<E>, java.util.Collection<E>, java.util.List<E>
    Direct Known Subclasses:
    PlotCommitList

    public class RevCommitList<E extends RevCommit>
    extends RevObjectList<E>
    An ordered list of RevCommit subclasses.
    • Constructor Summary

      Constructors 
      Constructor Description
      RevCommitList()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void applyFlag​(RevFilter matching, RevFlag flag)
      Apply a flag to all commits matching the specified filter.
      void applyFlag​(RevFilter matching, RevFlag flag, int rangeBegin, int rangeEnd)
      Apply a flag to all commits matching the specified filter.
      void clear()
      void clearFlag​(RevFlag flag)
      Remove the given flag from all commits.
      void clearFlag​(RevFlag flag, int rangeBegin, int rangeEnd)
      Remove the given flag from all commits.
      protected void enter​(int index, E e)
      Optional callback invoked when commits enter the list by fillTo.
      void fillTo​(int highMark)
      Ensure this list contains at least a specified number of commits.
      void fillTo​(RevCommit commitToLoad, int highMark)
      Ensures all commits until the given commit are loaded.
      int indexOf​(RevFlag flag, int begin)
      Find the next commit that has the given flag set.
      boolean isPending()
      Is this list still pending more items?
      int lastIndexOf​(RevFlag flag, int begin)
      Find the next commit that has the given flag set.
      void source​(RevWalk w)
      Set the revision walker this list populates itself from.
      • Methods inherited from class java.util.AbstractList

        add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, subList
      • Methods inherited from class java.util.AbstractCollection

        addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
    • Field Detail

    • Constructor Detail

      • RevCommitList

        public RevCommitList()
    • Method Detail

      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<E extends RevCommit>
        Specified by:
        clear in interface java.util.List<E extends RevCommit>
        Overrides:
        clear in class RevObjectList<E extends RevCommit>
      • applyFlag

        public void applyFlag​(RevFilter matching,
                              RevFlag flag)
                       throws MissingObjectException,
                              IncorrectObjectTypeException,
                              java.io.IOException
        Apply a flag to all commits matching the specified filter.

        Same as applyFlag(matching, flag, 0, size()), but without the incremental behavior.

        Parameters:
        matching - the filter to test commits with. If the filter includes a commit it will have the flag set; if the filter does not include the commit the flag will be unset.
        flag - the flag to apply (or remove). Applications are responsible for allocating this flag from the source RevWalk.
        Throws:
        java.io.IOException - revision filter needed to read additional objects, but an error occurred while reading the pack files or loose objects of the repository.
        IncorrectObjectTypeException - revision filter needed to read additional objects, but an object was not of the correct type. Repository corruption may have occurred.
        MissingObjectException - revision filter needed to read additional objects, but an object that should be present was not found. Repository corruption may have occurred.
      • applyFlag

        public void applyFlag​(RevFilter matching,
                              RevFlag flag,
                              int rangeBegin,
                              int rangeEnd)
                       throws MissingObjectException,
                              IncorrectObjectTypeException,
                              java.io.IOException
        Apply a flag to all commits matching the specified filter.

        This version allows incremental testing and application, such as from a background thread that needs to periodically halt processing and send updates to the UI.

        Parameters:
        matching - the filter to test commits with. If the filter includes a commit it will have the flag set; if the filter does not include the commit the flag will be unset.
        flag - the flag to apply (or remove). Applications are responsible for allocating this flag from the source RevWalk.
        rangeBegin - first commit within the list to begin testing at, inclusive. Must not be negative, but may be beyond the end of the list.
        rangeEnd - last commit within the list to end testing at, exclusive. If smaller than or equal to rangeBegin then no commits will be tested.
        Throws:
        java.io.IOException - revision filter needed to read additional objects, but an error occurred while reading the pack files or loose objects of the repository.
        IncorrectObjectTypeException - revision filter needed to read additional objects, but an object was not of the correct type. Repository corruption may have occurred.
        MissingObjectException - revision filter needed to read additional objects, but an object that should be present was not found. Repository corruption may have occurred.
      • clearFlag

        public void clearFlag​(RevFlag flag)
        Remove the given flag from all commits.

        Same as clearFlag(flag, 0, size()), but without the incremental behavior.

        Parameters:
        flag - the flag to remove. Applications are responsible for allocating this flag from the source RevWalk.
      • clearFlag

        public void clearFlag​(RevFlag flag,
                              int rangeBegin,
                              int rangeEnd)
        Remove the given flag from all commits.

        This method is actually implemented in terms of: applyFlag(RevFilter.NONE, flag, rangeBegin, rangeEnd).

        Parameters:
        flag - the flag to remove. Applications are responsible for allocating this flag from the source RevWalk.
        rangeBegin - first commit within the list to begin testing at, inclusive. Must not be negative, but may be beyond the end of the list.
        rangeEnd - last commit within the list to end testing at, exclusive. If smaller than or equal to rangeBegin then no commits will be tested.
      • indexOf

        public int indexOf​(RevFlag flag,
                           int begin)
        Find the next commit that has the given flag set.
        Parameters:
        flag - the flag to test commits against.
        begin - first commit index to test at. Applications may wish to begin at 0, to test the first commit in the list.
        Returns:
        index of the first commit at or after index begin that has the specified flag set on it; -1 if no match is found.
      • lastIndexOf

        public int lastIndexOf​(RevFlag flag,
                               int begin)
        Find the next commit that has the given flag set.
        Parameters:
        flag - the flag to test commits against.
        begin - first commit index to test at. Applications may wish to begin at size()-1, to test the last commit in the list.
        Returns:
        index of the first commit at or before index begin that has the specified flag set on it; -1 if no match is found.
      • source

        public void source​(RevWalk w)
        Set the revision walker this list populates itself from.
        Parameters:
        w - the walker to populate from.
        See Also:
        fillTo(int)
      • isPending

        public boolean isPending()
        Is this list still pending more items?
        Returns:
        true if fillTo(int) might be able to extend the list size when called.
      • enter

        protected void enter​(int index,
                             E e)
        Optional callback invoked when commits enter the list by fillTo.

        This method is only called during fillTo(int).

        Parameters:
        index - the list position this object will appear at.
        e - the object being added (or set) into the list.