@ThreadSafe public final class DiffKey extends Object
a0 [. a1 [. a2]] - b0 [. b1 [. b2]] [! series] |----------------| |----------------| revision path (a) revision path (b)
For example:
9712-8303.441 9059.9863.524-9360.9851.486!1
Each of the two draft revisions (left and right) is identified by a sequence of one to 3 page revisions that is known as a draft revision path. A series identifier is appended if the pollwiki revision series is non-zero.
Which of the two draft revisions is expressed as 'a' and which as 'b' is determined by the first applicable rule from the rule lists below. The following rule list applies only if both revisions have the same author. In that case they are ordered numerically by revision number. Traversing the two revision paths beginning at index zero yields a sequence of numeric pairs, one of which eventually differs:
The next rule list applies only if both revisions are position drafts in the same poll. In that case they are ordered by exclusive cast relation:
Otherwise the order is lexical by username:
Modifier and Type | Method and Description |
---|---|
static boolean |
isDartOrdered(CountNode aNode,
String aName,
CountNode bNode,
String bName)
|
static boolean |
isLexicallyOrdered(String aName,
String bName)
|
static String |
newReverseKey(String diffKey)
Constructs the reverse of the specified diff key in which the a-draft revision
path and b-draft revision path are interchanged.
|
public static boolean isDartOrdered(CountNode aNode, String aName, CountNode bNode, String bName)
IllegalArgumentException
- if aName
and
bName
are equal.public static boolean isLexicallyOrdered(String aName, String bName)
IllegalArgumentException
- if aName
and
bName
are equal.public static String newReverseKey(String diffKey)