Returns true if the relation holds.
354959
private static boolean polygonRelatePolyline_(Polygon polygon_a,
			Polyline polyline_b, double tolerance, int relation,
			ProgressTracker progress_tracker) {
		switch (relation) {
		case Relation.disjoint:
			return polygonDisjointPolyline_(polygon_a, polyline_b, tolerance,
					progress_tracker);

		case Relation.contains:
			return polygonContainsPolyline_(polygon_a, polyline_b, tolerance,
					progress_tracker);

		case Relation.touches:
			return polygonTouchesPolyline_(polygon_a, polyline_b, tolerance,
					progress_tracker);

		case Relation.crosses:
			return polygonCrossesPolyline_(polygon_a, polyline_b, tolerance,
					progress_tracker);

		default:
			break; // warning fix
		}

		return false;
	}
317762
private static boolean polygonRelateEnvelope_(Polygon polygon_a,
			Envelope envelope_b, double tolerance, int relation,
			ProgressTracker progress_tracker) {
		if (polygonDisjointEnvelope_(polygon_a, envelope_b, tolerance,
				progress_tracker)) {
			if (relation == Relation.disjoint)
				return true;

			return false;
		} else if (relation == Relation.disjoint) {
			return false;
		}

		switch (relation) {
		case Relation.within:
			return polygonWithinEnvelope_(polygon_a, envelope_b, tolerance,
					progress_tracker);

		case Relation.contains:
			return polygonContainsEnvelope_(polygon_a, envelope_b, tolerance,
					progress_tracker);

		case Relation.equals:
			return polygonEqualsEnvelope_(polygon_a, envelope_b, tolerance,
					progress_tracker);

		case Relation.touches:
			return polygonTouchesEnvelope_(polygon_a, envelope_b, tolerance,
					progress_tracker);

		case Relation.overlaps:
			return polygonOverlapsEnvelope_(polygon_a, envelope_b, tolerance,
					progress_tracker);

		case Relation.crosses:
			return polygonCrossesEnvelope_(polygon_a, envelope_b, tolerance,
					progress_tracker);

		default:
			break; // warning fix
		}

		return false;
	}
291958
def owner? obj, relation=nil
      if relation     
        return true if user_relation?(obj, relation)
      end                                
      [:user, :owner, :author].each do |relation|        
        return true if user_relation?(obj, relation)
      end
      false
    end
1189625
@Override
	public boolean hasNextCase() {
		for (ConstraintWrap wrap : summands) {
			if (wrap.constraint.hasNextCase()) {
				return true;
			}
		}
		return false;
	}
155306
private static boolean multiPointRelateEnvelope_(MultiPoint multipoint_a,
			Envelope envelope_b, double tolerance, int relation,
			ProgressTracker progress_tracker) {
		switch (relation) {
		case Relation.disjoint:
			return multiPointDisjointEnvelope_(multipoint_a, envelope_b,
					tolerance, progress_tracker);

		case Relation.within:
			return multiPointWithinEnvelope_(multipoint_a, envelope_b,
					tolerance, progress_tracker);

		case Relation.contains:
			return multiPointContainsEnvelope_(multipoint_a, envelope_b,
					tolerance, progress_tracker);

		case Relation.equals:
			return multiPointEqualsEnvelope_(multipoint_a, envelope_b,
					tolerance, progress_tracker);

		case Relation.touches:
			return multiPointTouchesEnvelope_(multipoint_a, envelope_b,
					tolerance, progress_tracker);

		case Relation.crosses:
			return multiPointCrossesEnvelope_(multipoint_a, envelope_b,
					tolerance, progress_tracker);

		default:
			break; // warning fix
		}

		return false;
	}
64523
private function hasRelation($type)
    {
        return in_array(
            $type,
            [
                ClassMetadataInfo::MANY_TO_MANY,
                ClassMetadataInfo::ONE_TO_MANY,
                ClassMetadataInfo::ONE_TO_ONE,
            ],
            true
        );
    }
556713
public function hasOwned()
    {
        if (!$this->owner->isInDB()) {
            return false;
        }

        $ownedRelationships = $this->owner->config()->get('owns') ?: [];
        foreach ($ownedRelationships as $relationship) {
            /* @var DataObject|SS_List $result */
            $result = $this->owner->{$relationship}();
            if ($result->exists()) {
                return true;
            }
        }

        return false;
    }
797521
def satisfies(self, other):  # type: (Term) -> bool
        
        return (
            self.dependency.name == other.dependency.name
            and self.relation(other) == SetRelation.SUBSET
        )
1130107
static boolean polygonRelatePolyline_(Polygon polygon_a,
			Polyline polyline_b, double tolerance, String scl,
			ProgressTracker progress_tracker) {
		RelationalOperationsMatrix relOps = new RelationalOperationsMatrix();
		relOps.resetMatrix_();
		relOps.setPredicates_(scl);
		relOps.setAreaLinePredicates_();

		Envelope2D env_a = new Envelope2D(), env_b = new Envelope2D();
		polygon_a.queryEnvelope2D(env_a);
		polyline_b.queryEnvelope2D(env_b);

		boolean bRelationKnown = false;
		boolean b_disjoint = RelationalOperations.envelopeDisjointEnvelope_(
				env_a, env_b, tolerance, progress_tracker);

		if (b_disjoint) {
			relOps.areaLineDisjointPredicates_(polygon_a, polyline_b); // passing polyline
															// to get boundary
															// information
			bRelationKnown = true;
		}

		if (!bRelationKnown) {
			// Quick rasterize test to see whether the the geometries are
			// disjoint, or if one is contained in the other.
			int relation = RelationalOperations
					.tryRasterizedContainsOrDisjoint_(polygon_a, polyline_b,
							tolerance, false);

			if (relation == RelationalOperations.Relation.disjoint) {
				relOps.areaLineDisjointPredicates_(polygon_a, polyline_b); // passing
																// polyline to
																// get boundary
																// information
				bRelationKnown = true;
			} else if (relation == RelationalOperations.Relation.contains) {
				relOps.areaLineContainsPredicates_(polygon_a, polyline_b); // passing
																// polyline to
																// get boundary
																// information
				bRelationKnown = true;
			}
		}

		if (!bRelationKnown) {
			EditShape edit_shape = new EditShape();
			int geom_a = edit_shape.addGeometry(polygon_a);
			int geom_b = edit_shape.addGeometry(polyline_b);
			relOps.setEditShapeCrackAndCluster_(edit_shape, tolerance,
					progress_tracker);
			relOps.m_cluster_index_b = relOps.m_topo_graph
					.createUserIndexForClusters();
			markClusterEndPoints_(geom_b, relOps.m_topo_graph,
					relOps.m_cluster_index_b);
			relOps.computeMatrixTopoGraphHalfEdges_(geom_a, geom_b);
			relOps.m_topo_graph
					.deleteUserIndexForClusters(relOps.m_cluster_index_b);
			relOps.m_topo_graph.removeShape();
		}

		boolean bRelation = relationCompare_(relOps.m_matrix, relOps.m_scl);
		return bRelation;
	}
845419
private boolean isUnidirestionalList(RelationshipList list) {
        if (list.size() > 0) {
            try {
                if (((AsymmetricRelationship) list.get(0)).getCommonParentIndex() == 0) {
                    return true;
                }
            } catch (java.lang.IndexOutOfBoundsException ex) {
                return true;
            }
        }
        return false;
    }
20977
public static <T extends Object & Comparable<? super T>> boolean hasRelation(SortedSet<T> a, int allow, SortedSet<T> b) {
        if (allow < NONE || allow > ANY) {
            throw new IllegalArgumentException("Relation " + allow + " out of range");
        }
        
        // extract filter conditions
        // these are the ALLOWED conditions Set
        
        boolean anb = (allow & A_NOT_B) != 0;
        boolean ab = (allow & A_AND_B) != 0;
        boolean bna = (allow & B_NOT_A) != 0;
        
        // quick check on sizes
        switch(allow) {
            case CONTAINS: if (a.size() < b.size()) return false; break;
            case ISCONTAINED: if (a.size() > b.size()) return false; break;
            case EQUALS: if (a.size() != b.size()) return false; break;
        }
        
        // check for null sets
        if (a.size() == 0) {
            if (b.size() == 0) return true;
            return bna;
        } else if (b.size() == 0) {
            return anb;
        }
        
        // pick up first strings, and start comparing
        Iterator<? extends T> ait = a.iterator();
        Iterator<? extends T> bit = b.iterator();
        
        T aa = ait.next();
        T bb = bit.next();
        
        while (true) {
            int comp = aa.compareTo(bb);
            if (comp == 0) {
                if (!ab) return false;
                if (!ait.hasNext()) {
                    if (!bit.hasNext()) return true;
                    return bna;
                } else if (!bit.hasNext()) {
                    return anb;
                }
                aa = ait.next();
                bb = bit.next();
            } else if (comp < 0) {
                if (!anb) return false;
                if (!ait.hasNext()) {
                    return bna;
                }
                aa = ait.next(); 
            } else  {
                if (!bna) return false;
                if (!bit.hasNext()) {
                    return anb;
                }
                bb = bit.next();
            }
        }
    }
37289
public function has($relation, $operator = '>=', $count = 1, $boolean = 'and', Closure $callback = null)
    {
        if (strpos($relation, '.') !== false) {
            return $this->hasNested($relation, $operator, $count, $boolean, $callback);
        }

        $relation = $this->getHasRelationQuery($relation);

        $query = $relation->getRelationCountQuery($relation->getRelated()->newQuery(), $this);

        if ($callback) call_user_func($callback, $query);

        return $this->addHasWhere($query, $relation, $operator, $count, $boolean);
    }
1142277
protected function hasRelation($key, $value, $relations)
	{
		if(is_numeric($relations)) {
			if($relations > 0) {
				return true;
			}
			return false;
		}

		foreach ($relations as $prop)
		{
			if($prop == 'assets')
			{
				if( $key === 'fields' || (! $this->resolved($value) && is_object($value) && property_exists($value, 'type') && $value->type == 'file'))
				{
					return true;
				}
				if(is_array($value) && ! empty($value))
				{
					$isAsset = true;
					foreach ($value as $subValue)
					{
						if(!$this->isUnresolvedAsset($subValue)) {
							$isAsset = false;
							break;
						}
					}
					if($isAsset) return true;
				}
			}
			if($prop === $key || 0 === strpos($prop, $key.'.'))
			{
				return true;
			}
		}

		return false;
	}
628621
private function hasRelation($type)
    {
        return in_array(
            $type,
            [
                ClassMetadataInfo::MANY_TO_MANY,
                ClassMetadataInfo::MANY_TO_ONE,
                ClassMetadataInfo::ONE_TO_ONE,
            ],
            true
        );
    }
6354
public function hasRelation($key)
    {
        if (array_key_exists($key, $this->relations)) {
            return true;
        }

        $entity = $this->getEntity();
        if (method_exists($entity, $key)) {
            return true;
        }

        return false;
    }
287456
private static boolean multiPointRelateMultiPoint_(MultiPoint multipoint_a,
			MultiPoint multipoint_b, double tolerance, int relation,
			ProgressTracker progress_tracker) {
		switch (relation) {
		case Relation.disjoint:
			return multiPointDisjointMultiPoint_(multipoint_a, multipoint_b,
					tolerance, progress_tracker);

		case Relation.within:
			return multiPointContainsMultiPoint_(multipoint_b, multipoint_a,
					tolerance, progress_tracker);

		case Relation.contains:
			return multiPointContainsMultiPoint_(multipoint_a, multipoint_b,
					tolerance, progress_tracker);

		case Relation.equals:
			return multiPointEqualsMultiPoint_(multipoint_a, multipoint_b,
					tolerance, progress_tracker);

		case Relation.overlaps:
			return multiPointOverlapsMultiPoint_(multipoint_a, multipoint_b,
					tolerance, progress_tracker);

		default:
			break; // warning fix
		}

		return false;
	}
1053442
private Boolean constraintsExistsForRelationship(String type, List<String> propertyNames) {
        Schema schema = db.schema();

        for (ConstraintDefinition constraintDefinition : Iterables.asList(schema.getConstraints(RelationshipType.withName(type)))) {
            List<String> properties = Iterables.asList(constraintDefinition.getPropertyKeys());

            if (properties.equals(propertyNames)) {
                return true;
            }
        }

        return false;
    }