public class DocumentRevsList extends java.lang.Object implements java.lang.Iterable<DocumentRevs>
List of DocumentRevs
. All the DocumentRevs
are for the same document.
If the DocumentRevisionTree is a forest, some of the DocumentRevs
might from different tree (case 2).
If two DocumentRevs
are from the same tree, they are different branch of that tree (case 1).
Case 1: they are from same tree. 1 → 2 → 3 | → 2* → 3* Case 2: they are from different trees 1 → 2 → 3 1* → 2* → 3*
The list can be iterated in the order of minimum generation id (min-generation). Each
DocumentRevs
has a list of revisions ids (aka revision history), and "start".
The "start" number is largest generation. So the min-generation is:
DocumentRevs.getRevisions().getStart() → DocumentRevs.getRevisions().getIds().size() + 1.
This is very important since it decides which DocumentRevs
is inserted to db first.
For DocumentRevs
with the same "min-generation", the order is un-determined. This is
probably the case two document with same id/body are created in different database.
Constructor and Description |
---|
DocumentRevsList(java.util.List<DocumentRevs> list) |
Modifier and Type | Method and Description |
---|---|
DocumentRevs |
get(int index) |
java.util.Iterator<DocumentRevs> |
iterator() |
java.lang.String |
toString() |
public DocumentRevsList(java.util.List<DocumentRevs> list)
public java.util.Iterator<DocumentRevs> iterator()
iterator
in interface java.lang.Iterable<DocumentRevs>
public DocumentRevs get(int index)
public java.lang.String toString()
toString
in class java.lang.Object