当前位置: 首页>>代码示例>>Java>>正文


Java Evaluator类代码示例

本文整理汇总了Java中org.neo4j.graphdb.traversal.Evaluator的典型用法代码示例。如果您正苦于以下问题:Java Evaluator类的具体用法?Java Evaluator怎么用?Java Evaluator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Evaluator类属于org.neo4j.graphdb.traversal包,在下文中一共展示了Evaluator类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPatternMatch

import org.neo4j.graphdb.traversal.Evaluator; //导入依赖的package包/类
private Traverser getPatternMatch(Node startNode, final List<String> patterns, final List<NodeLabel> nodeLabels, final List<LinkLabel> linkLabels) {
	TraversalDescription td = database.traversalDescription()
		.depthFirst()
		.evaluator( new Evaluator() {
			public Evaluation evaluate( final org.neo4j.graphdb.Path path ) {
                if ( path.length() == 0 ) {
                    return Evaluation.EXCLUDE_AND_CONTINUE;
                }
                boolean isToken = path.endNode().hasLabel(NodeLabel.WordToken);
                boolean included = isToken && (path.length() == 1 || nodeHasAnnotation(path.endNode(), linkLabels.get(path.length() - 1), patterns.get(path.length() - 1)));
                boolean continued = path.length() < patterns.size();
                return Evaluation.of( included, continued );
            }
        } )
		.relationships(LinkLabel.NEXT, Direction.OUTGOING)
		.relationships(LinkLabel.HAS_TYPE, Direction.INCOMING)
		.relationships(LinkLabel.HAS_LEMMA, Direction.INCOMING)
		.relationships(LinkLabel.HAS_POS_TAG, Direction.INCOMING)
		.relationships(LinkLabel.HAS_HEAD, Direction.INCOMING);
	return td.traverse(startNode);
}
 
开发者ID:Taalmonsters,项目名称:WhiteLab2.0-Neo4J-Plugin,代码行数:22,代码来源:QueryBenchmark.java

示例2: evaluate

import org.neo4j.graphdb.traversal.Evaluator; //导入依赖的package包/类
public Evaluation evaluate( Path position )
{
    boolean includes = true;
    boolean continues = true;
    for ( Evaluator evaluator : this.evaluators )
    {
        Evaluation bla = evaluator.evaluate( position );
        if ( !bla.includes() )
        {
            includes = false;
        }
        if ( !bla.continues() )
        {
            continues = false;
        }
        if ( !continues && !includes )
        {
            return Evaluation.EXCLUDE_AND_PRUNE;
        }
    }
    return Evaluation.of( includes, continues );
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-mobile-android,代码行数:23,代码来源:MultiEvaluator.java

示例3: addBlaEvaluator

import org.neo4j.graphdb.traversal.Evaluator; //导入依赖的package包/类
private Evaluator addBlaEvaluator( Evaluator evaluator )
{
    if ( this.evaluator instanceof MultiEvaluator )
    {
        return ((MultiEvaluator) this.evaluator).add( evaluator );
    }
    else
    {
        if ( this.evaluator == Evaluators.all() )
        {
            return evaluator;
        }
        else
        {
            return new MultiEvaluator( new Evaluator[] { this.evaluator, evaluator } );
        }
    }
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-mobile-android,代码行数:19,代码来源:TraversalDescriptionImpl.java

示例4: add

import org.neo4j.graphdb.traversal.Evaluator; //导入依赖的package包/类
public MultiEvaluator add( Evaluator evaluator )
{
    Evaluator[] newArray = new Evaluator[this.evaluators.length+1];
    System.arraycopy( this.evaluators, 0, newArray, 0, this.evaluators.length );
    newArray[newArray.length-1] = evaluator;
    return new MultiEvaluator( newArray );
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-mobile-android,代码行数:8,代码来源:MultiEvaluator.java

示例5: TraversalDescriptionImpl

import org.neo4j.graphdb.traversal.Evaluator; //导入依赖的package包/类
private TraversalDescriptionImpl( Expander expander,
        UniquenessFactory uniqueness, Object uniquenessParameter,
        Evaluator evaluator, BranchOrderingPolicy branchSelector )
{
    this.expander = expander;
    this.uniqueness = uniqueness;
    this.uniquenessParameter = uniquenessParameter;
    this.evaluator = evaluator;
    this.branchSelector = branchSelector;
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-mobile-android,代码行数:11,代码来源:TraversalDescriptionImpl.java

示例6: TraversalPrinter

import org.neo4j.graphdb.traversal.Evaluator; //导入依赖的package包/类
public TraversalPrinter( Evaluator innerEvaluator, String... propertyNames )
{
    this.innerEvaluator = innerEvaluator;
    this.propertyNames = asList( propertyNames );
}
 
开发者ID:sarmbruster,项目名称:unmanaged-extension,代码行数:6,代码来源:TraversalPrinter.java

示例7: MultiEvaluator

import org.neo4j.graphdb.traversal.Evaluator; //导入依赖的package包/类
MultiEvaluator( Evaluator... prunings )
{
    this.evaluators = prunings;
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-mobile-android,代码行数:5,代码来源:MultiEvaluator.java


注:本文中的org.neo4j.graphdb.traversal.Evaluator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。