Search in sources :

Example 11 with DiffType

use of org.sirix.diff.DiffFactory.DiffType in project sirix by sirixdb.

the class DiffSunburstAxis method setTempKey.

/**
 * Set temporal key which is the next following node of an {@code inserted},
 * {@code deleted}, {@code updated} or {@code same} node.
 */
private void setTempKey() {
    final int index = mIndex + mPrunedNodes + mDescendantCount;
    final boolean isOldTransaction = (mDiff == DiffType.DELETED || mDiff == DiffType.MOVEDFROM || mDiff == DiffType.REPLACEDOLD);
    final DiffDepth depthCont = mDiffCont.getDepth();
    final int depth = isOldTransaction ? depthCont.getOldDepth() : depthCont.getNewDepth();
    if (index < mSize) {
        DiffTuple nextDiffCont = mDiffs.get(index);
        DiffType nextDiff = nextDiffCont.getDiff();
        boolean nextIsOldTransaction = (nextDiff == DiffType.DELETED || nextDiff == DiffType.MOVEDFROM || nextDiff == DiffType.REPLACEDOLD);
        DiffDepth nextDepthCont = nextDiffCont.getDepth();
        int nextDepth = nextIsOldTransaction ? nextDepthCont.getOldDepth() : nextDepthCont.getNewDepth();
        assert nextDepth <= depth;
        mTempKey = nextIsOldTransaction ? nextDiffCont.getOldNodeKey() : nextDiffCont.getNewNodeKey();
    }
}
Also used : DiffTuple(org.sirix.diff.DiffTuple) DiffDepth(org.sirix.diff.DiffDepth) DiffType(org.sirix.diff.DiffFactory.DiffType)

Aggregations

DiffType (org.sirix.diff.DiffFactory.DiffType)11 DiffTuple (org.sirix.diff.DiffTuple)7 DiffDepth (org.sirix.diff.DiffDepth)4 ExecutionException (java.util.concurrent.ExecutionException)2 DatabaseException (com.sleepycat.je.DatabaseException)1 QNm (org.brackit.xquery.atomic.QNm)1 NodeReadTrx (org.sirix.api.NodeReadTrx)1 SirixException (org.sirix.exception.SirixException)1 NodeRelations (org.sirix.gui.view.sunburst.NodeRelations)1 SunburstItem (org.sirix.gui.view.sunburst.SunburstItem)1 EStructType (org.sirix.gui.view.sunburst.SunburstItem.EStructType)1