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

pingbu.nlp.SubtreeParams Maven / Gradle / Ivy

There is a newer version: 1.1.1
Show newest version
package pingbu.nlp;

import java.util.Collection;

/**
 * 参数语法子树,对下级子树产生参数表达式信息
 * 
 * @author pingbu
 */
class SubtreeParams extends Subtree {

    private final Collection mParams;
    private final Subtree mSubtree;

    public SubtreeParams(Collection params, Subtree subtree) {
        mParams = params;
        mSubtree = subtree;
    }

    private class Cursor extends Subtree.Cursor {

        public Cursor(Subtree.Cursor returnCursor) {
            super(returnCursor);
        }

        @Override
        public void navigate(Navigator navigator) {
            navigator.pushParams(mParams);
            mSubtree.newCursor(mReturnCursor).navigate(navigator);
            navigator.popParams(mParams);
        }
    }

    @Override
    public Subtree.Cursor newCursor(Subtree.Cursor returnCursor) {
        return new Cursor(returnCursor);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy