コード例 #1
0
ファイル: PTRN.java プロジェクト: animotron/core
        private void evalOther(final PFlow pf, final Relationship ref, final QCAVector answered) throws IOException {
        	IndexHits<Relationship> hits = Order._.context(pf.getOPNode());
        	try {
    	        for (Relationship r : hits) {
    	            Statement st = Statements.relationshipType(r);
    	            if (!(st instanceof Predicate)) {
	            		Pipe pipe = Evaluator._.execute(pf.getController(), answered.question(r));
                		QCAVector v;
                		while ((v = pipe.take()) != null) {
                			pf.sendAnswer(v);
                		}
    	            }
    	        }
        	} finally {
        		hits.close();
        	}
        }
コード例 #2
0
ファイル: PTRN.java プロジェクト: animotron/core
        private boolean filtering(final PFlow pf, final Relationship ref, final QCAVector answered) throws IOException, InterruptedException {
        	IndexHits<Relationship> hits = Order._.context(pf.getOPNode());
        	try {
    	        for (Relationship r : hits) {
    	            Statement st = Statements.relationshipType(r);
    	            if (st instanceof Predicate) {
	                    if (((Predicate) st).filter(pf, r, ref)) {
	                    	Pipe pipe = Evaluator._.execute(pf.getController(), answered, r.getEndNode());
	                		QCAVector v;
	                		while ((v = pipe.take()) != null) {
	                			pf.sendAnswer(v);
	                		}
	                        return true;
	                    }
    	            }
    	        }
        	} finally {
        		hits.close();
        	}
            return false;
        }