internal virtual void Add(T schemaDescriptor)
            {
                // Add optimized path for when property list is fully known
                Descriptors.Add(schemaDescriptor);
                int[] propertyKeyIds = SortedPropertyKeyIds(schemaDescriptor.schema());
                [email protected]_PropertySchemaType propertySchemaType = schemaDescriptor.schema().propertySchemaType();
                if (propertySchemaType == COMPLETE_ALL_TOKENS)
                {
                    // Just add the first token id to the top level set
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
                    Next.getIfAbsentPut(propertyKeyIds[0], PropertySet::new).add(schemaDescriptor, propertyKeyIds, 0);
                }
                else if (propertySchemaType == PARTIAL_ANY_TOKEN)
                {
                    // The internal data structure is built and optimized for when all property key tokens are required to match
                    // a particular descriptor. However to support the partial type, where any property key may match
                    // we will have to add such descriptors to all property key sets and pretend that each is the only one.
                    foreach (int propertyKeyId in propertyKeyIds)
                    {
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
                        Next.getIfAbsentPut(propertyKeyId, PropertySet::new).add(schemaDescriptor, new int[] { propertyKeyId }, 0);
                    }
                }
                else
                {
                    throw new System.NotSupportedException("Unknown property schema type " + propertySchemaType);
                }

                // Add fall-back path for when property list is only partly known
                foreach (int keyId in propertyKeyIds)
                {
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
                    ByAnyProperty.getIfAbsentPut(keyId, HashSet <object>::new).add(schemaDescriptor);
                }
            }
Beispiel #2
0
            internal virtual void AddSchemaRule(SchemaRule rule)
            {
                if (rule is ConstraintRule)
                {
                    ConstraintRule constraintRule = ( ConstraintRule )rule;
                    ConstraintRuleById.put(constraintRule.Id, constraintRule);
                    ConstraintsConflict.Add(ConstraintSemantics.readConstraint(constraintRule));
                }
                else if (rule is StoreIndexDescriptor)
                {
                    CapableIndexDescriptor index = IndexProviderMap.withCapabilities(( StoreIndexDescriptor )rule);
                    IndexDescriptorById.put(index.Id, index);
                    SchemaDescriptor schemaDescriptor = index.Schema();
                    IndexDescriptorsConflict[schemaDescriptor] = index;
                    IndexDescriptorsByName[rule.Name]          = index;
                    foreach (int entityTokenId in schemaDescriptor.EntityTokenIds)
                    {
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
                        ISet <CapableIndexDescriptor> forLabel = IndexDescriptorsByLabel.getIfAbsentPut(entityTokenId, HashSet <object>::new);
                        forLabel.Add(index);
                    }

                    foreach (int propertyId in index.Schema().PropertyIds)
                    {
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
                        IList <CapableIndexDescriptor> indexesForProperty = IndexByProperty.getIfAbsentPut(propertyId, List <object>::new);
                        indexesForProperty.Add(index);
                    }
                }
            }
        /// <summary>
        /// Adds the given descriptor to this set so that it can be looked up from any of the lookup methods.
        /// </summary>
        /// <param name="schemaDescriptor"> the descriptor to add. </param>
        public virtual void Add(T schemaDescriptor)
        {
            foreach (int entityTokenId in schemaDescriptor.schema().EntityTokenIds)
            {
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
                _byEntityToken.getIfAbsentPut(entityTokenId, PropertyMultiSet::new).add(schemaDescriptor);
            }
        }
        public virtual void AddRelationship(long relId, int typeId, RelationshipDirection direction)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.eclipse.collections.api.map.primitive.MutableIntObjectMap<org.eclipse.collections.api.set.primitive.MutableLongSet> relTypeToRelsMap = getTypeToRelMapForDirection(direction);
            MutableIntObjectMap <MutableLongSet> relTypeToRelsMap = GetTypeToRelMapForDirection(direction);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.eclipse.collections.api.set.primitive.MutableLongSet rels = relTypeToRelsMap.getIfAbsentPut(typeId, org.eclipse.collections.impl.set.mutable.primitive.LongHashSet::new);
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
            MutableLongSet rels = relTypeToRelsMap.getIfAbsentPut(typeId, LongHashSet::new);

            rels.add(relId);
        }
            internal virtual void Add(T schemaDescriptor, int[] propertyKeyIds, int cursor)
            {
                if (cursor == propertyKeyIds.Length - 1)
                {
                    FullDescriptors.Add(schemaDescriptor);
                }
                else
                {
                    int nextPropertyKeyId = propertyKeyIds[++cursor];
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
                    Next.getIfAbsentPut(nextPropertyKeyId, PropertySet::new).add(schemaDescriptor, propertyKeyIds, cursor);
                }
            }
Beispiel #6
0
            internal virtual int Add(Hit hit, int atDepth)
            {
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
                ICollection <Hit> depthHits = HitsConflict.getIfAbsentPut(atDepth, HashSet <object>::new);

                if (depthHits.Add(hit))
                {
                    TotalHitCount++;
                }
                if (LowestDepth == 0 || atDepth < LowestDepth)
                {
                    LowestDepth = atDepth;
                }
                return(TotalHitCount);
            }
Beispiel #7
0
        private MutableLongObjectMap <LockResource> LocalExclusive(ResourceType resourceType)
        {
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
            return(_exclusiveLocks.getIfAbsentPut(resourceType.TypeId(), LongObjectHashMap::new));
        }