test_class.file: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/RevisionVectorTest.java
test_class.identifier: RevisionVectorTest
test_case.body: @Test
      public void compareTo() {
          RevisionVector rv1 = new RevisionVector();
          RevisionVector rv2 = new RevisionVector();
          assertEquals(0, rv1.compareTo(rv2));
  
          Revision r11 = new Revision(1, 0, 1);
          rv1 = rv1.update(r11); // [r1-0-1]
          assertTrue(rv1.compareTo(rv2) > 0);
          assertTrue(rv2.compareTo(rv1) < 0);
  
          Revision r12 = new Revision(1, 0, 2);
          rv2 = rv2.update(r12); // [r1-0-2]
          assertTrue(rv1.compareTo(rv2) > 0);
          assertTrue(rv2.compareTo(rv1) < 0);
  
          rv2 = rv2.update(r11); // [r1-0-1, r1-0-2]
          assertTrue(rv1.compareTo(rv2) < 0);
          assertTrue(rv2.compareTo(rv1) > 0);
  
          rv1 = rv1.update(r12); // [r1-0-1, r1-0-2]
          assertEquals(0, rv1.compareTo(rv2));
          assertEquals(0, rv2.compareTo(rv1));
  
          Revision r22 = new Revision(2, 0, 2);
          rv2 = rv2.update(r22); // [r1-0-1, r2-0-2]
          assertTrue(rv1.compareTo(rv2) < 0);
          assertTrue(rv2.compareTo(rv1) > 0);
  
          Revision rb22 = r22.asBranchRevision();
          rv1 = rv1.update(rb22);
          assertTrue(rv1.compareTo(rv2) < 0);
          assertTrue(rv2.compareTo(rv1) > 0);
      }
test_case.class_method_signature: RevisionVectorTest.compareTo()
test_case.full_signature: @Test public void compareTo()
test_case.identifier: compareTo
test_case.invocations: assertEquals compareTo update assertTrue compareTo assertTrue compareTo update assertTrue compareTo assertTrue compareTo update assertTrue compareTo assertTrue compareTo update assertEquals compareTo assertEquals compareTo update assertTrue compareTo assertTrue compareTo asBranchRevision update assertTrue compareTo assertTrue compareTo
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void compareTo()
focal_class.declarator: log = LoggerFactory.getLogger(RevisionVector.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(RevisionVector.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: EMPTY = new RevisionVector()
focal_class.modifier: private final static
focal_class.original_string: private final static RevisionVector EMPTY = new RevisionVector();
focal_class.type: RevisionVector
focal_class.var_name: EMPTY
focal_class.declarator: revisions
focal_class.modifier: private final
focal_class.original_string: private final Revision[] revisions;
focal_class.type: Revision[]
focal_class.var_name: revisions
focal_class.declarator: hash
focal_class.modifier: private
focal_class.original_string: private int hash;
focal_class.type: int
focal_class.var_name: hash
focal_class.file: oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/RevisionVector.java
focal_class.identifier: RevisionVector
focal_class.interfaces: implements Iterable<Revision>, Comparable<RevisionVector>, CacheValue
focal_class.class_method_signature: RevisionVector.RevisionVector(@NotNull Revision[] revisions,
                             boolean checkUniqueClusterIds,
                             boolean sort)
focal_class.full_signature: private  RevisionVector(@NotNull Revision[] revisions,
                             boolean checkUniqueClusterIds,
                             boolean sort)
focal_class.identifier: RevisionVector
focal_class.modifiers: private
focal_class.parameters: (@NotNull Revision[] revisions,
                             boolean checkUniqueClusterIds,
                             boolean sort)
focal_class.signature:  RevisionVector(@NotNull Revision[] revisions,
                             boolean checkUniqueClusterIds,
                             boolean sort)
focal_class.class_method_signature: RevisionVector.RevisionVector(@NotNull Revision... revisions)
focal_class.full_signature: public  RevisionVector(@NotNull Revision... revisions)
focal_class.identifier: RevisionVector
focal_class.modifiers: public
focal_class.parameters: (@NotNull Revision... revisions)
focal_class.signature:  RevisionVector(@NotNull Revision... revisions)
focal_class.class_method_signature: RevisionVector.RevisionVector(@NotNull Iterable<Revision> revisions)
focal_class.full_signature: public  RevisionVector(@NotNull Iterable<Revision> revisions)
focal_class.identifier: RevisionVector
focal_class.modifiers: public
focal_class.parameters: (@NotNull Iterable<Revision> revisions)
focal_class.signature:  RevisionVector(@NotNull Iterable<Revision> revisions)
focal_class.class_method_signature: RevisionVector.RevisionVector(@NotNull Set<Revision> revisions)
focal_class.full_signature: public  RevisionVector(@NotNull Set<Revision> revisions)
focal_class.identifier: RevisionVector
focal_class.modifiers: public
focal_class.parameters: (@NotNull Set<Revision> revisions)
focal_class.signature:  RevisionVector(@NotNull Set<Revision> revisions)
focal_class.class_method_signature: RevisionVector.update(@NotNull Revision revision)
focal_class.full_signature: public RevisionVector update(@NotNull Revision revision)
focal_class.identifier: update
focal_class.modifiers: public
focal_class.parameters: (@NotNull Revision revision)
focal_class.return: RevisionVector
focal_class.signature: RevisionVector update(@NotNull Revision revision)
focal_class.class_method_signature: RevisionVector.remove(int clusterId)
focal_class.full_signature: public RevisionVector remove(int clusterId)
focal_class.identifier: remove
focal_class.modifiers: public
focal_class.parameters: (int clusterId)
focal_class.return: RevisionVector
focal_class.signature: RevisionVector remove(int clusterId)
focal_class.class_method_signature: RevisionVector.pmin(@NotNull RevisionVector vector)
focal_class.full_signature: public RevisionVector pmin(@NotNull RevisionVector vector)
focal_class.identifier: pmin
focal_class.modifiers: public
focal_class.parameters: (@NotNull RevisionVector vector)
focal_class.return: RevisionVector
focal_class.signature: RevisionVector pmin(@NotNull RevisionVector vector)
focal_class.class_method_signature: RevisionVector.pmax(@NotNull RevisionVector vector)
focal_class.full_signature: public RevisionVector pmax(@NotNull RevisionVector vector)
focal_class.identifier: pmax
focal_class.modifiers: public
focal_class.parameters: (@NotNull RevisionVector vector)
focal_class.return: RevisionVector
focal_class.signature: RevisionVector pmax(@NotNull RevisionVector vector)
focal_class.class_method_signature: RevisionVector.difference(RevisionVector vector)
focal_class.full_signature: public RevisionVector difference(RevisionVector vector)
focal_class.identifier: difference
focal_class.modifiers: public
focal_class.parameters: (RevisionVector vector)
focal_class.return: RevisionVector
focal_class.signature: RevisionVector difference(RevisionVector vector)
focal_class.class_method_signature: RevisionVector.isRevisionNewer(@NotNull Revision revision)
focal_class.full_signature: public boolean isRevisionNewer(@NotNull Revision revision)
focal_class.identifier: isRevisionNewer
focal_class.modifiers: public
focal_class.parameters: (@NotNull Revision revision)
focal_class.return: boolean
focal_class.signature: boolean isRevisionNewer(@NotNull Revision revision)
focal_class.class_method_signature: RevisionVector.isBranch()
focal_class.full_signature: public boolean isBranch()
focal_class.identifier: isBranch
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isBranch()
focal_class.class_method_signature: RevisionVector.getBranchRevision()
focal_class.full_signature: @NotNull public Revision getBranchRevision()
focal_class.identifier: getBranchRevision
focal_class.modifiers: @NotNull public
focal_class.parameters: ()
focal_class.return: Revision
focal_class.signature: Revision getBranchRevision()
focal_class.class_method_signature: RevisionVector.getRevision(int clusterId)
focal_class.full_signature: public Revision getRevision(int clusterId)
focal_class.identifier: getRevision
focal_class.modifiers: public
focal_class.parameters: (int clusterId)
focal_class.return: Revision
focal_class.signature: Revision getRevision(int clusterId)
focal_class.class_method_signature: RevisionVector.asString()
focal_class.full_signature: public String asString()
focal_class.identifier: asString
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String asString()
focal_class.class_method_signature: RevisionVector.toStringBuilder(StringBuilder sb)
focal_class.full_signature: public StringBuilder toStringBuilder(StringBuilder sb)
focal_class.identifier: toStringBuilder
focal_class.modifiers: public
focal_class.parameters: (StringBuilder sb)
focal_class.return: StringBuilder
focal_class.signature: StringBuilder toStringBuilder(StringBuilder sb)
focal_class.class_method_signature: RevisionVector.fromString(String s)
focal_class.full_signature: public static RevisionVector fromString(String s)
focal_class.identifier: fromString
focal_class.modifiers: public static
focal_class.parameters: (String s)
focal_class.return: RevisionVector
focal_class.signature: RevisionVector fromString(String s)
focal_class.class_method_signature: RevisionVector.asTrunkRevision()
focal_class.full_signature: public RevisionVector asTrunkRevision()
focal_class.identifier: asTrunkRevision
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: RevisionVector
focal_class.signature: RevisionVector asTrunkRevision()
focal_class.class_method_signature: RevisionVector.asBranchRevision(int clusterId)
focal_class.full_signature: public RevisionVector asBranchRevision(int clusterId)
focal_class.identifier: asBranchRevision
focal_class.modifiers: public
focal_class.parameters: (int clusterId)
focal_class.return: RevisionVector
focal_class.signature: RevisionVector asBranchRevision(int clusterId)
focal_class.class_method_signature: RevisionVector.getDimensions()
focal_class.full_signature: public int getDimensions()
focal_class.identifier: getDimensions
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getDimensions()
focal_class.class_method_signature: RevisionVector.getMemory()
focal_class.full_signature: @Override public int getMemory()
focal_class.identifier: getMemory
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getMemory()
focal_class.class_method_signature: RevisionVector.compareTo(@NotNull RevisionVector other)
focal_class.full_signature: @Override public int compareTo(@NotNull RevisionVector other)
focal_class.identifier: compareTo
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull RevisionVector other)
focal_class.return: int
focal_class.signature: int compareTo(@NotNull RevisionVector other)
focal_class.class_method_signature: RevisionVector.iterator()
focal_class.full_signature: @Override public Iterator<Revision> iterator()
focal_class.identifier: iterator
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Iterator<Revision>
focal_class.signature: Iterator<Revision> iterator()
focal_class.class_method_signature: RevisionVector.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: RevisionVector.equals(Object o)
focal_class.full_signature: @Override public boolean equals(Object o)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object o)
focal_class.return: boolean
focal_class.signature: boolean equals(Object o)
focal_class.class_method_signature: RevisionVector.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: RevisionVector.peekRevision(PeekingIterator<Revision> it,
                                    int minClusterId)
focal_class.full_signature: @Nullable private Revision peekRevision(PeekingIterator<Revision> it,
                                    int minClusterId)
focal_class.identifier: peekRevision
focal_class.modifiers: @Nullable private
focal_class.parameters: (PeekingIterator<Revision> it,
                                    int minClusterId)
focal_class.return: Revision
focal_class.signature: Revision peekRevision(PeekingIterator<Revision> it,
                                    int minClusterId)
focal_class.class_method_signature: RevisionVector.revisionArrayMemory()
focal_class.full_signature: private long revisionArrayMemory()
focal_class.identifier: revisionArrayMemory
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long revisionArrayMemory()
focal_class.class_method_signature: RevisionVector.checkUniqueClusterIds(Revision[] revisions)
focal_class.full_signature: private static void checkUniqueClusterIds(Revision[] revisions)
focal_class.identifier: checkUniqueClusterIds
focal_class.modifiers: private static
focal_class.parameters: (Revision[] revisions)
focal_class.return: void
focal_class.signature: void checkUniqueClusterIds(Revision[] revisions)
focal_method.body: @Override
      public int compareTo(@NotNull RevisionVector other) {
          Iterator<Revision> it = other.iterator();
          for (Revision r : revisions) {
              if (!it.hasNext()) {
                  return 1;
              }
              Revision otherRev = it.next();
              int cmp = -Ints.compare(r.getClusterId(), otherRev.getClusterId());
              if (cmp != 0) {
                  return cmp;
              }
              cmp = r.compareTo(otherRev);
              if (cmp != 0) {
                  return cmp;
              }
          }
          return it.hasNext() ? -1 : 0;
      }
focal_method.class_method_signature: RevisionVector.compareTo(@NotNull RevisionVector other)
focal_method.full_signature: @Override public int compareTo(@NotNull RevisionVector other)
focal_method.identifier: compareTo
focal_method.invocations: iterator hasNext next compare getClusterId getClusterId compareTo hasNext
focal_method.modifiers: @Override public
focal_method.parameters: (@NotNull RevisionVector other)
focal_method.return: int
focal_method.signature: int compareTo(@NotNull RevisionVector other)