public boolean matched()

in hugegraph-core/src/main/java/org/apache/hugegraph/backend/store/ram/RamTable.java [258:296]


    public boolean matched(Query query) {
        if (this.edgesSize() == 0L || this.loading) {
            return false;
        }
        if (!query.resultType().isEdge() ||
            !(query instanceof ConditionQuery)) {
            return false;
        }

        ConditionQuery cq = (ConditionQuery) query;

        int conditionsSize = cq.conditionsSize();
        Object owner = cq.condition(HugeKeys.OWNER_VERTEX);
        Directions direction = cq.condition(HugeKeys.DIRECTION);
        Id label = cq.condition(HugeKeys.LABEL);

        if (direction == null && conditionsSize > 1) {
            for (Condition cond : cq.conditions()) {
                if (cond.equals(BOTH_COND)) {
                    direction = Directions.BOTH;
                    break;
                }
            }
        }

        int matchedConds = 0;
        if (owner != null) {
            matchedConds++;
        } else {
            return false;
        }
        if (direction != null) {
            matchedConds++;
        }
        if (label != null) {
            matchedConds++;
        }
        return matchedConds == cq.conditionsSize();
    }