All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.simy4.xpath.view.ViewContext Maven / Gradle / Ivy

There is a newer version: 2.3.9
Show newest version
package com.github.simy4.xpath.view;

import com.github.simy4.xpath.navigator.Navigator;
import com.github.simy4.xpath.navigator.Node;

public final class ViewContext {

    private final Navigator navigator;
    private final NodeView current;
    private final boolean greedy;
    private final boolean hasNext;
    private final int position;

    public ViewContext(Navigator navigator, NodeView current, boolean greedy) {
        this(navigator, current, greedy, false, 1);
    }

    /**
     * Constructor.
     *
     * @param navigator XML navigator
     * @param current   XML context node view
     * @param greedy    is context greedy
     * @param hasNext   is there a node after this
     * @param position  XML context node position
     */
    public ViewContext(Navigator navigator, NodeView current, boolean greedy, boolean hasNext, int position) {
        this.navigator = navigator;
        this.current = current;
        this.greedy = greedy;
        this.hasNext = hasNext;
        this.position = position;
    }

    public Navigator getNavigator() {
        return navigator;
    }

    public NodeView getCurrent() {
        return current;
    }

    public boolean isGreedy() {
        return greedy;
    }

    public boolean hasNext() {
        return hasNext;
    }

    public int getPosition() {
        return position;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy