Package org.geotools.filter.text.commons

Examples of org.geotools.filter.text.commons.Result


       
        try {
            Object built = build(n);
          
            IToken tokenAdapter = TokenAdapter.newAdapterFor(token);
            Result r = new Result(built, tokenAdapter, n.getType());
            this.builder.pushResult(r );
           
        } finally {
            n.dispose();
        }
View Full Code Here


    private Or buildBeforeOrDuring()
            throws CQLException {
        Or filter = null;

        Result node = this.builder.peekResult();

        switch (node.getNodeType()) {
        case JJTPERIOD_BETWEEN_DATES_NODE:
        case JJTPERIOD_WITH_DATE_DURATION_NODE:
        case JJTPERIOD_WITH_DURATION_DATE_NODE:
            filter = this.builder.buildBeforeOrDuring();
            break;

        default:
            throw new CQLException(
                    "unexpeted date time expression in temporal predicate.",
                    node.getToken(), this.source);
        }

        return filter;
    }
View Full Code Here

    private Or buildDuringOrAfter()
            throws CQLException {
        Or filter = null;

        Result node = this.builder.peekResult();

        switch (node.getNodeType()) {
        case JJTPERIOD_BETWEEN_DATES_NODE:
        case JJTPERIOD_WITH_DATE_DURATION_NODE:
        case JJTPERIOD_WITH_DURATION_DATE_NODE:
            filter = this.builder.buildDuringOrAfter();

            break;

        default:
            throw new CQLException(
                    "unexpeted date time expression in temporal predicate.",
                    node.getToken(), this.source);
        }

        return filter;
    }
View Full Code Here

    private Before buildBeforePredicate()
            throws CQLException {
        Before filter = null;

        // analyzes if the last build is period or date
        Result node = this.builder.peekResult();

        switch (node.getNodeType()) {
        case JJTDATETIME_NODE:
            filter = this.builder.buildBeforeDate();
            break;

        case JJTPERIOD_BETWEEN_DATES_NODE:
        case JJTPERIOD_WITH_DATE_DURATION_NODE:
        case JJTPERIOD_WITH_DURATION_DATE_NODE:
            filter = this.builder.buildBeforePeriod();
            break;

        default:
            throw new CQLException(
                    "unexpeted date time expression in temporal predicate.",
                    node.getToken(), this.source);
        }
        return filter;
    }
View Full Code Here

     */
    private During buildDuring() throws CQLException {
        During filter = null;

        // determines if the node is period or date
        Result node = this.builder.peekResult();

        switch (node.getNodeType()) {
        case JJTPERIOD_BETWEEN_DATES_NODE:
        case JJTPERIOD_WITH_DATE_DURATION_NODE:
        case JJTPERIOD_WITH_DURATION_DATE_NODE:
            filter = this.builder.buildDuringPeriod();
            break;

        default:
            throw new CQLException(
                    "unexpeted period expression in temporal predicate.", node
                            .getToken(), this.source);
        }

        return filter;
    }
View Full Code Here

    private After buildAfterPredicate()
            throws CQLException {
        After filter = null;

        // determines if the node is period or date
        Result result = this.builder.peekResult();

        switch (result.getNodeType()) {
        case JJTDATETIME_NODE:
          filter = this.builder.buildAfterDate();
            break;

        case JJTPERIOD_BETWEEN_DATES_NODE:
        case JJTPERIOD_WITH_DURATION_DATE_NODE:
        case JJTPERIOD_WITH_DATE_DURATION_NODE:
            filter = this.builder.buildAfterPeriod();
            break;

        default:
            throw new CQLException(
                    "unexpeted date time expression in temporal predicate.",
                    result.getToken(), this.source);
        }

        return filter;
    }
View Full Code Here

     */
    protected Stack<Coordinate> popCoordinatesOf(int geomNode) throws CQLException {
        Stack<Coordinate> stack = new Stack<Coordinate>();
        while (!getResultStack().empty()) {

            Result result = getResultStack().peek();

            int node = result.getNodeType();
            if (node != geomNode) {
                break;
            }
            getResultStack().popResult();
            Coordinate coordinate = (Coordinate)result.getBuilt();

            stack.push(coordinate);
        }
        return stack;
    }
View Full Code Here

    protected List<Geometry> popGeometry(final int geometryNode) throws org.geotools.filter.text.cql2.CQLException{

        List<Geometry> geomList = new LinkedList<Geometry>();
        while( !getResultStack().empty() ) {
           
            Result result = getResultStack().peek();
            if(result.getNodeType() != geometryNode){
                break;
            }
            getResultStack().popResult();
           
            Geometry geometry = (Geometry)result.getBuilt();
            geomList.add(geometry);
        }
        Collections.reverse(geomList);

        return geomList;
View Full Code Here

    protected List<Geometry> popGeometryLiteral(final int geometryNode) throws CQLException{

        List<Geometry> geomList = new LinkedList<Geometry>();
        while( !getResultStack().empty() ) {
           
            Result result = getResultStack().peek();
            if(result.getNodeType() != geometryNode){
                break;
            }
            getResultStack().popResult();
           
            Literal geometry = (Literal)result.getBuilt();
            geomList.add((Geometry) geometry.getValue());
        }
        Collections.reverse(geomList);

        return geomList;
View Full Code Here

        // retrieves the id from stack
        List<FeatureId> idList = new LinkedList<FeatureId>();
        while (!getResultStack().empty()) {

            Result result = getResultStack().peek();

            int node = result.getNodeType();
            if (node != nodeFeatureId) {
                break;
            }
            FeatureId id = (FeatureId) result.getBuilt();
            idList.add(id);
            getResultStack().popResult();
        }
        assert idList.size() >= 1 : "must have one or more FeatureIds";
View Full Code Here

TOP

Related Classes of org.geotools.filter.text.commons.Result

Copyright © 2018 www.massapicom. 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.