예제 #1
0
 public override bool Equals(object obj)
 {
     if (this == obj)
     {
         return(true);
     }
     if (obj is PathProxy)
     {
         PathProxy that = ( PathProxy )obj;
         return(Arrays.Equals(this._nodes, that._nodes) && Arrays.Equals(this._relationships, that._relationships));
     }
     else if (obj is Path)
     {
         Path other = ( Path )obj;
         if (_nodes[0] != other.StartNode().Id)
         {
             return(false);
         }
         return(iteratorsEqual(this.Relationships().GetEnumerator(), other.Relationships().GetEnumerator()));
     }
     else
     {
         return(false);
     }
 }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldIterateThroughNodesInReverse()
        public virtual void ShouldIterateThroughNodesInReverse()
        {
            // given
            Path path = new PathProxy(_proxySPI, new long[] { 1, 2, 3 }, new long[] { 100, 200 }, new int[] { 0, ~0 });

            IEnumerator <Node> iterator = path.ReverseNodes().GetEnumerator();
            Node node;

            // then
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertTrue(iterator.hasNext());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertThat(node = iterator.next(), instanceOf(typeof(Node)));
            assertEquals(3, node.Id);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertTrue(iterator.hasNext());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertThat(node = iterator.next(), instanceOf(typeof(Node)));
            assertEquals(2, node.Id);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertTrue(iterator.hasNext());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertThat(node = iterator.next(), instanceOf(typeof(Node)));
            assertEquals(1, node.Id);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertFalse(iterator.hasNext());
        }
예제 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldIterateThroughRelationshipsInReverse()
        public virtual void ShouldIterateThroughRelationshipsInReverse()
        {
            // given
            Path path = new PathProxy(_proxySPI, new long[] { 1, 2, 3 }, new long[] { 100, 200 }, new int[] { 0, ~0 });

            IEnumerator <Relationship> iterator = path.ReverseRelationships().GetEnumerator();
            Relationship relationship;

            // then
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertTrue(iterator.hasNext());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertThat(relationship = iterator.next(), instanceOf(typeof(Relationship)));
            assertEquals(200, relationship.Id);
            assertEquals(3, relationship.StartNodeId);
            assertEquals(2, relationship.EndNodeId);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertTrue(iterator.hasNext());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertThat(relationship = iterator.next(), instanceOf(typeof(Relationship)));
            assertEquals(100, relationship.Id);
            assertEquals(1, relationship.StartNodeId);
            assertEquals(2, relationship.EndNodeId);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertFalse(iterator.hasNext());
        }
예제 #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldIterateAlternatingNodesAndRelationships()
        public virtual void ShouldIterateAlternatingNodesAndRelationships()
        {
            // given
            Path path = new PathProxy(_proxySPI, new long[] { 1, 2, 3 }, new long[] { 100, 200 }, new int[] { 0, ~0 });

            IEnumerator <PropertyContainer> iterator = path.GetEnumerator();
            PropertyContainer entity;

            // then
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertTrue(iterator.hasNext());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertThat(entity = iterator.next(), instanceOf(typeof(Node)));
            assertEquals(1, (( Entity )entity).Id);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertTrue(iterator.hasNext());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertThat(entity = iterator.next(), instanceOf(typeof(Relationship)));
            assertEquals(100, (( Entity )entity).Id);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertTrue(iterator.hasNext());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertThat(entity = iterator.next(), instanceOf(typeof(Node)));
            assertEquals(2, (( Entity )entity).Id);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertTrue(iterator.hasNext());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertThat(entity = iterator.next(), instanceOf(typeof(Relationship)));
            assertEquals(200, (( Entity )entity).Id);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertTrue(iterator.hasNext());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertThat(entity = iterator.next(), instanceOf(typeof(Node)));
            assertEquals(3, (( Entity )entity).Id);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertFalse(iterator.hasNext());
        }
예제 #5
0
 public IteratorAnonymousInnerClass5(PathProxy outerInstance)
 {
     this.outerInstance = outerInstance;
 }
예제 #6
0
 public IteratorAnonymousInnerClass4(PathProxy outerInstance)
 {
     this.outerInstance = outerInstance;
     i = outerInstance.nodes.Length;
 }
예제 #7
0
 public IteratorAnonymousInnerClass2(PathProxy outerInstance)
 {
     this.outerInstance = outerInstance;
     i = outerInstance.relationships.Length;
 }