Esempio n. 1
0
 private void AddElement(long element)
 {
     if (_removed.Empty || !_removed.remove(element))
     {
         _added.add(element);
     }
 }
Esempio n. 2
0
 private bool RemoveElement(long element)
 {
     if (!_added.Empty && _added.remove(element))
     {
         return(true);
     }
     return(_removed.add(element));
 }
Esempio n. 3
0
 internal static void AssertFoundRelationships(RelationshipIndexCursor edge, int edges, MutableLongSet uniqueIds)
 {
     for (int i = 0; i < edges; i++)
     {
         assertTrue("at least " + edges + " relationships", edge.Next());
         assertTrue(uniqueIds.add(edge.RelationshipReference()));
     }
     assertFalse("no more than " + edges + " relationships", edge.Next());
 }
Esempio n. 4
0
 internal static void AssertNodeCount(NodeIndexCursor node, int expectedCount, MutableLongSet uniqueIds)
 {
     uniqueIds.clear();
     for (int i = 0; i < expectedCount; i++)
     {
         assertTrue("at least " + expectedCount + " nodes", node.Next());
         assertTrue(uniqueIds.add(node.NodeReference()));
     }
     assertFalse("no more than " + expectedCount + " nodes", node.Next());
 }
Esempio n. 5
0
 internal static void AssertNodes(NodeIndexCursor node, MutableLongSet uniqueIds, params long[] expected)
 {
     uniqueIds.clear();
     foreach (long count in expected)
     {
         assertTrue("at least " + expected.Length + " nodes", node.Next());
         assertTrue(uniqueIds.add(node.NodeReference()));
     }
     assertFalse("no more than " + expected.Length + " nodes", node.Next());
     assertEquals("all nodes are unique", expected.Length, uniqueIds.size());
     foreach (long expectedNode in expected)
     {
         assertTrue("expected node " + expectedNode, uniqueIds.contains(expectedNode));
     }
 }
Esempio n. 6
0
 public override bool Check(TraversalBranch branch)
 {
     return(_visited.add(Type.getId(branch)));
 }
Esempio n. 7
0
 public override void Node(long id)
 {
     _nodeIds.add(id);
 }
Esempio n. 8
0
 public override void Property(long id)
 {
     _propertyIds.add(id);
 }
Esempio n. 9
0
 public override void Relationship(long id)
 {
     _relationshipIds.add(id);
 }
Esempio n. 10
0
 public override void SchemaIndex(long id)
 {
     _schemaIndexesIds.add(id);
 }