Examples of BooleanResult


Examples of com.vividsolutions.jtstest.testrunner.BooleanResult

  private Result invokeMethod(Method method, Geometry geometry, Object[] args)
      throws Exception
  {
    try {
      if (method.getReturnType() == boolean.class) {
        return new BooleanResult((Boolean) method.invoke(geometry, args));
      }
      if (Geometry.class.isAssignableFrom(method.getReturnType())) {
        return new GeometryResult((Geometry) method.invoke(geometry, args));
      }
      if (method.getReturnType() == double.class) {
View Full Code Here

Examples of com.vividsolutions.jtstest.testrunner.BooleanResult

    return testToReturn;
  }

  private Result getDefaultResult(String opName) {
    if (GeometryMethodOperation.isBooleanFunction(opName)) {
      return new BooleanResult(true);
    }
    if (GeometryMethodOperation.isGeometryFunction(opName)) {
      return new GeometryResult(
      new GeometryFactory(testCase.getTestRun().getPrecisionModel(),
      0).createGeometryCollection(null));
View Full Code Here

Examples of com.vividsolutions.jtstest.testrunner.BooleanResult

        || GeometryMethodOperation.isGeometryFunction(opName));
    for (Iterator i = testCase.getTests().iterator(); i.hasNext(); ) {
      Test test = (Test) i.next();
      if (test.getOperation().equalsIgnoreCase(opName)
           && ((!opName.equalsIgnoreCase("relate"))
           || test.getExpectedResult().equals(new BooleanResult(true)))
           && (test.getGeometryIndex().equalsIgnoreCase("A"))
           && ((test.getArgumentCount() == 0) || (
          test.getArgument(0) != null
           && (test.getArgument(0).equalsIgnoreCase("B"))))) {
        return test;
View Full Code Here

Examples of lupos.datastructures.queryresult.BooleanResult

        this.handleGraphResult(res, (GraphResult) resQueryResult);
      } else if (resQueryResult instanceof BooleanResult) {
        if (this.br_list == null) {
          this.br_list = new LinkedList<BooleanResult>();
        }
        final BooleanResult br = new BooleanResult();
        this.br_list.add(br);
        final Iterator<Bindings> itb = res.oneTimeIterator();
        if (!itb.hasNext()) {
          this.updateCommentPanel();
        } else {
View Full Code Here

Examples of lupos.datastructures.queryresult.BooleanResult

public class MakeBooleanResult extends SingleInputOperator {

  @Override
  public QueryResult process(QueryResult qr, final int operandID) {
    final BooleanResult br = new BooleanResult();
    if (!qr.isEmpty())
      br.add(qr.oneTimeIterator().next());
    qr.release();
    qr = null;
    return br;
  }
View Full Code Here

Examples of lupos.datastructures.queryresult.BooleanResult

          br_list = new LinkedList<BooleanResult>();
        }
        if(oneTime){
          br_list.add((BooleanResult)res);
        } else {
          final BooleanResult br = new BooleanResult();
          br.addAll(res);
          br_list.add(br);
        }
      } else {
        if(oneTime){
          if (qr == null){
View Full Code Here

Examples of lupos.datastructures.queryresult.BooleanResult

    if (result == null) {
      if (type == null)
        return null;
      switch (type) {
      case ASK:
        return new BooleanResult();
      case CONSTRUCT:
        return new GraphResult();
      default:
        return QueryResult.createInstance();
      }
View Full Code Here

Examples of lupos.datastructures.queryresult.BooleanResult

  public QueryResult getResult() throws Exception {
    final QueryExecution qe = QueryExecutionFactory.create(query, model);
    if (query.isAskType()) {
      if (qe.execAsk()) {
        // unempty => true
        final QueryResult qr = new BooleanResult();
        qr.add(new BindingsCollection());
        return qr;
      } else {
        final QueryResult qr = new BooleanResult();
        qe.close();
        return qr;
      }
    } else if (query.isSelectType()) {
      final ResultSet results = qe.execSelect();
View Full Code Here

Examples of lupos.datastructures.queryresult.BooleanResult

    } finally {
      this.lock.unlock();
    }

    if(this.booleanResult){
      final BooleanResult result = new BooleanResult();
      if(this.resultOfBooleanResult){
        result.add(bindingsFactory.createInstance());
      }
      return result;
    } else {
      // This allows to follow the iterator concept also here:
      // the XML is parsed whenever the iterator is asked for the next element (method next).
View Full Code Here

Examples of lupos.datastructures.queryresult.BooleanResult

  public QueryResult getQueryResult(final InputStream inputStream, final BindingsFactory bindingsFactory) {
    try {
      final JSONObject object = new JSONObject(new JSONTokener(new InputStreamReader(inputStream)));
      if(object.has("boolean")){
        final boolean b=object.getBoolean("boolean");
        final BooleanResult br = new BooleanResult();
        if(b){
          br.add(bindingsFactory.createInstance());
        }
        return br;
      } else {
        return QueryResult.createInstance(new ImmutableIterator<Bindings>(){
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.