public virtual int AugmentDegree(RelationshipDirection direction, int degree, int typeId)
        {
            switch (direction)
            {
            case RelationshipDirection.INCOMING:
                if (_incoming != null && _incoming.containsKey(typeId))
                {
                    return(_diffStrategy.augmentDegree(degree, _incoming.get(typeId).size()));
                }
                break;

            case RelationshipDirection.OUTGOING:
                if (_outgoing != null && _outgoing.containsKey(typeId))
                {
                    return(_diffStrategy.augmentDegree(degree, _outgoing.get(typeId).size()));
                }
                break;

            case RelationshipDirection.LOOP:
                if (_loops != null && _loops.containsKey(typeId))
                {
                    return(_diffStrategy.augmentDegree(degree, _loops.get(typeId).size()));
                }
                break;

            default:
                throw new System.ArgumentException("Unknown direction: " + direction);
            }

            return(degree);
        }
示例#2
0
        private bool AtLeastOneRelevantChange(SchemaDescriptor schema)
        {
            bool affectedBefore = Schema.isAffected(_entityTokensBefore);
            bool affectedAfter  = Schema.isAffected(_entityTokensAfter);

            if (affectedBefore && affectedAfter)
            {
                foreach (int propertyId in Schema.PropertyIds)
                {
                    if (_knownProperties.containsKey(propertyId))
                    {
                        return(true);
                    }
                }
                return(false);
            }
            return(affectedBefore || affectedAfter);
        }
 internal virtual bool Has(int propertyKey)
 {
     return(ByAnyProperty.containsKey(propertyKey));
 }
 /// <summary>
 /// Cheap way of finding out whether or not there are any descriptors matching the given entity token id.
 /// </summary>
 /// <param name="entityTokenId"> entity token id to check. </param>
 /// <returns> {@code true} if there are one or more descriptors matching the given entity token. </returns>
 internal virtual bool Has(int entityTokenId)
 {
     return(_byEntityToken.containsKey(entityTokenId));
 }