Example #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public org.neo4j.collection.PrimitiveLongResourceIterator query(org.neo4j.internal.kernel.api.IndexQuery... predicates) throws org.neo4j.internal.kernel.api.exceptions.schema.IndexNotApplicableKernelException
        public override PrimitiveLongResourceIterator Query(params IndexQuery[] predicates)
        {
//JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter:
            IndexSlot slot = SlotSelector.selectSlot(predicates, IndexQuery::valueGroup);

            return(slot != null?InstanceSelector.select(slot).query(predicates) : concat(InstanceSelector.transform(reader => reader.query(predicates))));
        }
Example #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void add(java.util.Collection<? extends org.neo4j.kernel.api.index.IndexEntryUpdate<?>> updates) throws org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException
        public override void Add <T1>(ICollection <T1> updates) where T1 : Org.Neo4j.Kernel.Api.Index.IndexEntryUpdate <T1>
        {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: LazyInstanceSelector<java.util.Collection<org.neo4j.kernel.api.index.IndexEntryUpdate<?>>> batchSelector = new LazyInstanceSelector<>(slot -> new java.util.ArrayList<>());
            LazyInstanceSelector <ICollection <IndexEntryUpdate <object> > > batchSelector = new LazyInstanceSelector <ICollection <IndexEntryUpdate <object> > >(slot => new List <>());

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: for (org.neo4j.kernel.api.index.IndexEntryUpdate<?> update : updates)
            foreach (IndexEntryUpdate <object> update in updates)
            {
                batchSelector.Select(SlotSelector.selectSlot(update.Values(), GroupOf)).Add(update);
            }

            // Manual loop due do multiple exception types
            foreach (IndexSlot slot in Enum.GetValues(typeof(IndexSlot)))
            {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.Collection<org.neo4j.kernel.api.index.IndexEntryUpdate<?>> batch = batchSelector.getIfInstantiated(slot);
                ICollection <IndexEntryUpdate <object> > batch = batchSelector.GetIfInstantiated(slot);
                if (batch != null)
                {
                    this.InstanceSelector.select(slot).add(batch);
                }
            }
        }
Example #3
0
 private void Awake()
 {
     PreLoadSlots();
     audioSource        = GetComponent <AudioSource>();
     itemDetailsScript  = itemDetails.GetComponent <ItemDetails>();
     slotSelectorScript = slotSelector.GetComponent <SlotSelector>();
     UpdateSlotText();
 }
Example #4
0
 public FusionIndexProvider(IndexProvider stringProvider, IndexProvider numberProvider, IndexProvider spatialProvider, IndexProvider temporalProvider, IndexProvider luceneProvider, SlotSelector slotSelector, IndexProviderDescriptor descriptor, IndexDirectoryStructure.Factory directoryStructure, FileSystemAbstraction fs, bool archiveFailedIndex) : base(descriptor, directoryStructure)
 {
     this._archiveFailedIndex = archiveFailedIndex;
     this._slotSelector       = slotSelector;
     this._providers          = new InstanceSelector <IndexProvider>();
     this._dropAction         = new FileSystemIndexDropAction(fs, directoryStructure());
     FillProvidersSelector(stringProvider, numberProvider, spatialProvider, temporalProvider, luceneProvider);
     slotSelector.ValidateSatisfied(_providers);
 }
Example #5
0
 public static void Initialize()
 {
     mainMenu     = new MainMenu();
     LoadGameMenu = new LoadGameMenu();
     ingameMenu   = new IngameMenu();
     newGameMenu  = new NewGameMenu();
     SlotSelector = new SlotSelector();
     OptionMenuManager.Initialize();
 }
Example #6
0
    private void LaunchProjectile()
    {
        SlotSelector selector = FindObjectOfType <SlotSelector>();
        Item         item     = selector.GetThrowingItem();

        if (item != null)
        {
            GameObject projectile = Instantiate(potionPrefab, this.transform.position, this.transform.rotation);        // spawn a potionPrefab
            projectile.GetComponent <Projectile>().Initialize(item);
            if (force > 200f)
            {
                force = 200f;
            }
            projectile.GetComponent <Rigidbody2D>().AddForce((angle * (force * -1)), ForceMode2D.Force);         // give the projectile an appropriate force at the appropriate angle

            float torque = Random.Range(-3f, 3f);
            projectile.GetComponent <Rigidbody2D>().AddTorque(torque);           // add a little random spin (looks nice!)
        }
    }
Example #7
0
        public override bool HasFullValuePrecision(params IndexQuery[] predicates)
        {
//JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter:
            IndexSlot slot = SlotSelector.selectSlot(predicates, IndexQuery::valueGroup);

            if (slot != null)
            {
                return(InstanceSelector.select(slot).hasFullValuePrecision(predicates));
            }
            else
            {
                // UNKNOWN slot which basically means the EXISTS predicate
                if (!(predicates.Length == 1 && predicates[0] is IndexQuery.ExistsPredicate))
                {
                    throw new System.InvalidOperationException("Selected IndexReader null for predicates " + Arrays.ToString(predicates));
                }
                return(true);
            }
        }
Example #8
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void query(org.neo4j.storageengine.api.schema.IndexProgressor_NodeValueClient cursor, org.neo4j.internal.kernel.api.IndexOrder indexOrder, boolean needsValues, org.neo4j.internal.kernel.api.IndexQuery... predicates) throws org.neo4j.internal.kernel.api.exceptions.schema.IndexNotApplicableKernelException
        public override void Query(Org.Neo4j.Storageengine.Api.schema.IndexProgressor_NodeValueClient cursor, IndexOrder indexOrder, bool needsValues, params IndexQuery[] predicates)
        {
//JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter:
            IndexSlot slot = SlotSelector.selectSlot(predicates, IndexQuery::valueGroup);

            if (slot != null)
            {
                InstanceSelector.select(slot).query(cursor, indexOrder, needsValues, predicates);
            }
            else
            {
                if (indexOrder != IndexOrder.NONE)
                {
                    throw new System.NotSupportedException(format("Tried to query index with unsupported order %s. Supported orders for query %s are %s.", indexOrder, Arrays.ToString(predicates), IndexOrder.NONE));
                }
                BridgingIndexProgressor multiProgressor = new BridgingIndexProgressor(cursor, _descriptor.schema().PropertyIds);
                cursor.Initialize(_descriptor, multiProgressor, predicates, indexOrder, needsValues);
                try
                {
                    InstanceSelector.forAll(reader =>
                    {
                        try
                        {
                            reader.query(multiProgressor, indexOrder, needsValues, predicates);
                        }
                        catch (IndexNotApplicableKernelException e)
                        {
                            throw new InnerException(e);
                        }
                    });
                }
                catch (InnerException e)
                {
                    throw e.InnerException;
                }
            }
        }
Example #9
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void process(org.neo4j.kernel.api.index.IndexEntryUpdate<?> update) throws org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException
        public override void Process <T1>(IndexEntryUpdate <T1> update)
        {
            switch (update.UpdateMode())
            {
            case ADDED:
                InstanceSelector.select(SlotSelector.selectSlot(update.Values(), GroupOf)).process(update);
                break;

            case CHANGED:
                // Hmm, here's a little conundrum. What if we change from a value that goes into native
                // to a value that goes into fallback, or vice versa? We also don't want to blindly pass
                // all CHANGED updates to both updaters since not all values will work in them.
                IndexUpdater from = InstanceSelector.select(SlotSelector.selectSlot(update.BeforeValues(), GroupOf));
                IndexUpdater to   = InstanceSelector.select(SlotSelector.selectSlot(update.Values(), GroupOf));
                // There are two cases:
                // - both before/after go into the same updater --> pass update into that updater
                if (from == to)
                {
                    from.Process(update);
                }
                // - before go into one and after into the other --> REMOVED from one and ADDED into the other
                else
                {
                    from.Process(IndexEntryUpdate.remove(update.EntityId, update.IndexKey(), update.BeforeValues()));
                    to.Process(IndexEntryUpdate.add(update.EntityId, update.IndexKey(), update.Values()));
                }
                break;

            case REMOVED:
                InstanceSelector.select(SlotSelector.selectSlot(update.Values(), GroupOf)).process(update);
                break;

            default:
                throw new System.ArgumentException("Unknown update mode");
            }
        }
Example #10
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setup()
        public virtual void Setup()
        {
            _slotSelector = FusionVersion.slotSelector();
            SetupMocks();
        }
Example #11
0
        private FusionIndexProvider CreateFusionProvider(LuceneIndexProvider luceneProvider, IndexProvider failingProvider)
        {
            SlotSelector slotSelector = Org.Neo4j.Kernel.Impl.Index.Schema.fusion.SlotSelector_Fields.NullInstance;

            return(new FusionIndexProvider(failingProvider, EMPTY, EMPTY, EMPTY, luceneProvider, slotSelector, _providerDescriptor, _directoryFactory, Fs.get(), false));
        }
Example #12
0
 public override long CountIndexedNodes(long nodeId, int[] propertyKeyIds, params Value[] propertyValues)
 {
     return(InstanceSelector.select(SlotSelector.selectSlot(propertyValues, GroupOf)).countIndexedNodes(nodeId, propertyKeyIds, propertyValues));
 }
Example #13
0
 internal FusionIndexReader(SlotSelector slotSelector, LazyInstanceSelector <IndexReader> instanceSelector, IndexDescriptor descriptor) : base(slotSelector, instanceSelector)
 {
     this._descriptor = descriptor;
 }
Example #14
0
 internal FusionIndexBase(SlotSelector slotSelector, InstanceSelector <T> instanceSelector)
 {
     this.SlotSelector     = slotSelector;
     this.InstanceSelector = instanceSelector;
 }
Example #15
0
 internal FusionIndexUpdater(SlotSelector slotSelector, LazyInstanceSelector <IndexUpdater> instanceSelector) : base(slotSelector, instanceSelector)
 {
 }
Example #16
0
 internal FusionIndexPopulator(SlotSelector slotSelector, InstanceSelector <IndexPopulator> instanceSelector, long indexId, IndexDropAction dropAction, bool archiveFailedIndex) : base(slotSelector, instanceSelector)
 {
     this._indexId            = indexId;
     this._dropAction         = dropAction;
     this._archiveFailedIndex = archiveFailedIndex;
 }
Example #17
0
 public override void ValidateBeforeCommit(Value[] tuple)
 {
     InstanceSelector.select(SlotSelector.selectSlot(tuple, GroupOf)).validateBeforeCommit(tuple);
 }
Example #18
0
 internal FusionIndexAccessor(SlotSelector slotSelector, InstanceSelector <IndexAccessor> instanceSelector, StoreIndexDescriptor descriptor, IndexDropAction dropAction) : base(slotSelector, instanceSelector)
 {
     this._descriptor = descriptor;
     this._dropAction = dropAction;
 }
Example #19
0
 public override void ValidateSatisfied(InstanceSelector <IndexProvider> instances)
 {
     SlotSelector.validateSelectorInstances(instances, NUMBER, LUCENE, SPATIAL, TEMPORAL);
 }
Example #20
0
 public override void IncludeSample <T1>(IndexEntryUpdate <T1> update)
 {
     InstanceSelector.select(SlotSelector.selectSlot(update.Values(), GroupOf)).includeSample(update);
 }