package ru.ifmo.nds.domtree;

import ru.ifmo.nds.util.DominanceHelper;

class Node implements Comparable<Node> {
    double[] point;
    Node next, child;
    final int index;

    Node(int index) {
        this.index = index;
        this.next = null;
        this.child = null;
    }

    void initialize(double[] point) {
        this.point = point;
        this.next = null;
        this.child = null;
    }

    boolean strictlyDominatesAssumingLexicographicallySmaller(Node other) {
        return DominanceHelper.strictlyDominatesAssumingLexicographicallySmaller(point, other.point, point.length - 1);
    }

    int dominanceComparison(Node other) {
        return DominanceHelper.dominanceComparison(point, other.point, point.length);
    }

    // assumes b != null && b.next == null
    static Node concatenate(Node a, Node b) {
        if (a == null) {
            return b;
        }
        int bIndex = b.index;
        if (a.index > bIndex) {
            b.next = a;
            return b;
        }
        Node prev = a, next = a.next;
        while (next != null) {
            if (next.index > bIndex) {
                b.next = next;
                break;
            }
            prev = next;
            next = next.next;
        }
        prev.next = b;
        return a;
    }

    @Override
    public int compareTo(Node o) {
        return index - o.index;
    }
}

@@ -748,561 +748,8 @@
  %7D%0A%0A
-    // assumes b != null && b.next == null%0A    static Node concatenate(Node a, Node b) %7B%0A        if (a == null) %7B%0A            return b;%0A        %7D%0A        int bIndex = b.index;%0A        if (a.index %3E bIndex) %7B%0A            b.next = a;%0A            return b;%0A        %7D%0A        Node prev = a, next = a.next;%0A        while (next != null) %7B%0A            if (next.index %3E bIndex) %7B%0A                b.next = next;%0A                break;%0A            %7D%0A            prev = next;%0A            next = next.next;%0A        %7D%0A        prev.next = b;%0A        return a;%0A    %7D%0A%0A
     

Drop the unused method in Node.