Package org.eclipse.emf.query.conditions

Examples of org.eclipse.emf.query.conditions.Condition


        }
        return eIDSet;
    }
   
    public static final Condition eq(final Set<Identifier> eIDs) {
        return new Condition() {
           
            @Override
            public boolean isSatisfied(Object value) {
                if(value instanceof Feature) {
                    for(Identifier it : eIDs) {
View Full Code Here


     */
    public EObjectCondition encode(Filter filter) throws EFeatureEncoderException {
        try {
            eCondition = null;
            eConditionStack.clear();
            Condition condition = (Condition)filter.accept(this, null);
            if(condition instanceof EObjectCondition) {
                eCondition = condition;
            } else {
                eCondition = new EObjectConditionAdapter(condition);
            }
View Full Code Here

     */
    protected Condition visit(BinaryLogicOperator filter, Object extraData) {

        // Initialize
        //
        Condition eCondition = null;

        // Get name logic operator
        //
        String operator = ((String) extraData).toUpperCase();

        // Get filter iterator
        //
        Iterator<Filter> list = filter.getChildren().iterator();

        // Is inverse operator?
        //
        if ("OR".equals(operator)) {
            while (list.hasNext()) {

                // Build filter recursively and put onto condition stack
                //
                list.next().accept(this, extraData);

                // Initialize?
                //
                if (eCondition == null) {
                    eCondition = eConditionStack.pop();
                } else {
                    eCondition = eCondition.OR(eConditionStack.pop());
                }

            }
        } else if ("AND".equals(operator)) {
            while (list.hasNext()) {

                // Build filter recursively and put onto condition stack
                //
                list.next().accept(this, extraData);

                // Initialize?
                //
                if (eCondition == null) {
                    eCondition = eConditionStack.pop();
                } else {
                    eCondition = eCondition.AND(eConditionStack.pop());
                }

            }
        } else {
            throw new RuntimeException("Binary logical " + "operator " + operator
View Full Code Here

        //
        // Initialize
        //
        Literal value = null;
        String name = null;
        Condition eCondition = null;
        //
        // Get left and right expression
        //
        Expression left = filter.getExpression1();
        Expression right = filter.getExpression2();
View Full Code Here

    public static Condition bbox(Geometry value, final boolean swapped) {
        final Envelope bbox = value.getEnvelopeInternal();
        if (bbox.isNull()) {
            return Condition.FALSE;
        }
        return new Condition() {

            @Override
            public boolean isSatisfied(Object object) {
                if (object instanceof Geometry) {
                    Envelope extent = ((Geometry) object).getEnvelopeInternal();
View Full Code Here

    public static Condition beyond(final Geometry value, final double distance) {
        if (value.isEmpty()) {
            return Condition.FALSE;
        }

        return new Condition() {

            @Override
            public boolean isSatisfied(Object object) {
                if (object instanceof Geometry) {
                    return !DistanceOp.isWithinDistance(value, (Geometry) object, distance);
View Full Code Here

    public static Condition dwithin(final Geometry value, final double distance) {
        if (value.isEmpty()) {
            return Condition.FALSE;
        }

        return new Condition() {

            @Override
            public boolean isSatisfied(Object object) {
                if (object instanceof Geometry) {
                    return DistanceOp.isWithinDistance(value, (Geometry) object, distance);
View Full Code Here

    public static Condition contains(final Geometry value, final boolean swapped) {
        if (value.isEmpty()) {
            return Condition.FALSE;
        }
        return new Condition() {

            @Override
            public boolean isSatisfied(Object object) {
                if (object instanceof Geometry) {
                    Geometry geom = (Geometry) object;
View Full Code Here

    public static Condition crosses(final Geometry value, final boolean swapped) {
        if (value.isEmpty()) {
            return Condition.FALSE;
        }
        return new Condition() {

            @Override
            public boolean isSatisfied(Object object) {
                if (object instanceof Geometry) {
                    Geometry geom = (Geometry) object;
View Full Code Here

    public static Condition disjoint(final Geometry value, final boolean swapped) {
        if (value.isEmpty()) {
            return Condition.FALSE;
        }
        return new Condition() {

            @Override
            public boolean isSatisfied(Object object) {
                if (object instanceof Geometry) {
                    Geometry geom = (Geometry) object;
View Full Code Here

TOP

Related Classes of org.eclipse.emf.query.conditions.Condition

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.