Esempio n. 1
0
 private void Exhaust(LongIterator iterator)
 {
     while (iterator.hasNext())
     {
         iterator.next();
     }
 }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void tailBeforeHeadCorrectIteration()
        internal virtual void TailBeforeHeadCorrectIteration()
        {
            PrimitiveLongArrayQueue queue = CreateQueue();

            for (int i = 0; i < 14; i++)
            {
                queue.Enqueue(i);
            }
            for (int i = 0; i < 10; i++)
            {
                assertEquals(i, queue.Dequeue());
            }
            for (int i = 14; i < 24; i++)
            {
                queue.Enqueue(i);
            }

            assertEquals(14, queue.Size());
            LongIterator iterator = queue.LongIterator();

            for (int j = 10; j < 24; j++)
            {
                assertTrue(iterator.hasNext());
                assertEquals(j, iterator.next());
            }
            assertFalse(iterator.hasNext());
        }
 public override bool Next()
 {
     if (_added != null && _added.hasNext())
     {
         this._node = _added.next();
         return(true);
     }
     else
     {
         return(InnerNext());
     }
 }
Esempio n. 4
0
        private static LongSet Drain(LongIterator iter)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.eclipse.collections.api.set.primitive.MutableLongSet result = new org.eclipse.collections.impl.set.mutable.primitive.LongHashSet();
            MutableLongSet result = new LongHashSet();

            while (iter.hasNext())
            {
                result.add(iter.next());
            }
            return(result);
        }
Esempio n. 5
0
 private void AssertIds(RecordIdIterator ids, params long[][] expectedIds)
 {
     foreach (long[] expectedArray in expectedIds)
     {
         LongIterator iterator = ids.NextBatch();
         assertNotNull(iterator);
         foreach (long expectedId in expectedArray)
         {
             assertEquals(expectedId, iterator.next());
         }
         assertFalse(iterator.hasNext());
     }
     assertNull(ids.NextBatch());
 }
Esempio n. 6
0
			  protected internal override R FetchNextOrNull()
			  {
					while ( Ids.hasNext() )
					{
						 Store.getRecordByCursor( Ids.next(), Record, RecordLoad.CHECK, Cursor );
						 if ( Record.inUse() )
						 {
							  if ( PassesFilters( Record ) )
							  {
									return Record;
							  }
						 }
					}
					return default( R );
			  }
Esempio n. 7
0
        public override bool Next()
        {
            // Check tx state
            bool hasChanges = hasChanges();

            if (hasChanges && _addedNodes.hasNext())
            {
                _storeCursor.Current = _addedNodes.next();
                return(true);
            }

            while (_storeCursor.next())
            {
                if (!hasChanges || !_read.txState().nodeIsDeletedInThisTx(_storeCursor.entityReference()))
                {
                    return(true);
                }
            }
            return(false);
        }
        public override bool Next()
        {
            // Check tx state
            bool hasChanges = hasChanges();

            if (hasChanges && _addedRelationships.hasNext())
            {
                Read.txState().relationshipVisit(_addedRelationships.next(), StoreCursor);
                return(true);
            }

            while (StoreCursor.next())
            {
                if (!hasChanges || !Read.txState().relationshipIsDeletedInThisTx(StoreCursor.entityReference()))
                {
                    return(true);
                }
            }
            return(false);
        }
 /// <summary>
 /// Store all types that was added in the transaction for the current node
 /// </summary>
 private void CheckTxStateForUpdates()
 {
     if (_read.hasTxStateWithChanges())
     {
         NodeState    nodeState          = _read.txState().getNodeState(_storeCursor.OwningNode);
         LongIterator addedRelationships = nodeState.AddedRelationships;
         while (addedRelationships.hasNext())
         {
             RelationshipState relationshipState = _read.txState().getRelationshipState(addedRelationships.next());
             relationshipState.Accept((relationshipId, typeId, startNodeId, endNodeId) => _txTypes.add(typeId));
         }
     }
 }