Unnamed: 0 int64 0 6.7k | func stringlengths 12 89.6k | target bool 2
classes | project stringlengths 45 151 |
|---|---|---|---|
3,500 | public class SchemaIndexWaitingAcceptanceTest
{
private final ControlledPopulationSchemaIndexProvider provider = new ControlledPopulationSchemaIndexProvider();
@Rule
public ImpermanentDatabaseRule rule = new ImpermanentDatabaseRule()
{
@Override
protected void configure( GraphDatabaseFa... | false | community_kernel_src_test_java_org_neo4j_graphdb_SchemaIndexWaitingAcceptanceTest.java |
3,501 | public class GraphDatabaseFactory
{
private final GraphDatabaseFactoryState state;
public GraphDatabaseFactory()
{
this( new GraphDatabaseFactoryState() );
}
protected GraphDatabaseFactory(GraphDatabaseFactoryState state)
{
this.state = state;
}
protected GraphDatabase... | false | community_kernel_src_main_java_org_neo4j_graphdb_factory_GraphDatabaseFactory.java |
3,502 | public static class Delegator extends GraphDatabaseBuilder
{
private final GraphDatabaseBuilder actual;
public Delegator( GraphDatabaseBuilder actual )
{
super( null );
this.actual = actual;
}
@Override
public GraphDatabaseBuilder setConf... | false | community_kernel_src_main_java_org_neo4j_graphdb_factory_GraphDatabaseBuilder.java |
3,503 | public class GraphDatabaseBuilder
{
public interface DatabaseCreator
{
GraphDatabaseService newDatabase( Map<String, String> config );
}
protected DatabaseCreator creator;
protected Map<String, String> config = new HashMap<String, String>();
public GraphDatabaseBuilder( DatabaseCreator... | false | community_kernel_src_main_java_org_neo4j_graphdb_factory_GraphDatabaseBuilder.java |
3,504 | class Adapter<T> implements TransactionEventHandler<T>
{
@Override
public T beforeCommit( TransactionData data ) throws Exception
{
return null;
}
@Override
public void afterCommit( TransactionData data, T state )
{
}
@Overrid... | false | community_kernel_src_main_java_org_neo4j_graphdb_event_TransactionEventHandler.java |
3,505 | public class TransactionFailureException extends RuntimeException
{
public TransactionFailureException( String msg )
{
super( msg );
}
public TransactionFailureException( String msg, Throwable cause )
{
super( msg, cause );
}
} | false | community_kernel_src_main_java_org_neo4j_graphdb_TransactionFailureException.java |
3,506 | {
public boolean isStopNode( final TraversalPosition currentPosition )
{
return currentPosition.depth() >= 1;
}
}; | false | community_kernel_src_main_java_org_neo4j_graphdb_StopEvaluator.java |
3,507 | {
public boolean isStopNode( final TraversalPosition currentPosition )
{
return false;
}
}; | false | community_kernel_src_main_java_org_neo4j_graphdb_StopEvaluator.java |
3,508 | {
@Override
protected void configure( GraphDatabaseFactory databaseFactory )
{
List<KernelExtensionFactory<?>> extensions;
extensions = Arrays.<KernelExtensionFactory<?>>asList( singleInstanceSchemaIndexProviderFactory(
"test", provider ) );
... | false | community_kernel_src_test_java_org_neo4j_graphdb_SchemaIndexWaitingAcceptanceTest.java |
3,509 | {
@Override
public void call( Schema self )
{
self.awaitIndexOnline( INDEX_DEFINITION, 1l, TimeUnit.SECONDS );
}
}; | false | community_kernel_src_test_java_org_neo4j_graphdb_SchemaFacadeMethods.java |
3,510 | {
@Override
public void call( Schema self )
{
self.indexFor( LABEL );
}
}; | false | community_kernel_src_test_java_org_neo4j_graphdb_SchemaFacadeMethods.java |
3,511 | {
@Override
public void call( Schema self )
{
self.getConstraints();
}
}; | false | community_kernel_src_test_java_org_neo4j_graphdb_SchemaFacadeMethods.java |
3,512 | {
@Override
public void call( Schema self )
{
self.getConstraints( LABEL );
}
}; | false | community_kernel_src_test_java_org_neo4j_graphdb_SchemaFacadeMethods.java |
3,513 | {
@Override
public void call( Schema self )
{
self.constraintFor( LABEL );
}
}; | false | community_kernel_src_test_java_org_neo4j_graphdb_SchemaFacadeMethods.java |
3,514 | {
@Override
public void call( Schema self )
{
self.getIndexFailure( INDEX_DEFINITION );
}
}; | false | community_kernel_src_test_java_org_neo4j_graphdb_SchemaFacadeMethods.java |
3,515 | {
@Override
public void call( Schema self )
{
self.getIndexState( INDEX_DEFINITION );
}
}; | false | community_kernel_src_test_java_org_neo4j_graphdb_SchemaFacadeMethods.java |
3,516 | {
@Override
public void call( Schema self )
{
self.getIndexes();
}
}; | false | community_kernel_src_test_java_org_neo4j_graphdb_SchemaFacadeMethods.java |
3,517 | {
@Override
public void call( Schema self )
{
self.getIndexes( LABEL );
}
}; | false | community_kernel_src_test_java_org_neo4j_graphdb_SchemaFacadeMethods.java |
3,518 | {
@Override
public void call( Schema self )
{
self.awaitIndexesOnline( 1l, TimeUnit.SECONDS );
}
}; | false | community_kernel_src_test_java_org_neo4j_graphdb_SchemaFacadeMethods.java |
3,519 | public class LuceneLabelScanStoreIT extends LabelScanStoreIT
{
// Just extending the IT from kernel which pulls in the same tests, but with the important difference
// that the LuceneLasbelScanStore is on the class path, and will therefore be selected instead of
// an in-memory store.
} | false | community_lucene-index_src_test_java_org_neo4j_graphdb_LuceneLabelScanStoreIT.java |
3,520 | {
@Override
public void run( FileSystemAbstraction fs, File storeDirectory )
{
try
{
int filesCorrupted = 0;
for ( File file : labelScanStoreIndexDirectory( storeDirectory ).listFiles() )
... | false | community_lucene-index_src_test_java_org_neo4j_graphdb_LuceneLabelScanStoreChaosIT.java |
3,521 | {
public int compare( HeapObject o1, HeapObject o2 )
{
return costComparator.compare( o1.getCost(), o2.getCost() );
}
} ); | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_shortestpath_DijkstraPriorityQueueFibonacciImpl.java |
3,522 | public class TestDijkstra extends Neo4jAlgoTestCase
{
private Relationship createGraph( boolean includeOnes )
{
/* Layout:
* (y)
* ^
* [2] _____[1]___
* \ v |
... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestDijkstra.java |
3,523 | public class TestAllPaths extends Neo4jAlgoTestCase
{
protected PathFinder<Path> instantiatePathFinder( int maxDepth )
{
return allPaths( expanderForAllTypes(), maxDepth );
}
@Test
public void testCircularGraph()
{
/* Layout
*
* (a)---(b)===(c)---(e)
*... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestAllPaths.java |
3,524 | {
@Override
public Double getCost( Node node, Node goal )
{
double dx = (Double) node.getProperty( "x" )
- (Double) goal.getProperty( "x" );
double dy = (Double) node.getProperty( "y" )
- (Double) goal.getProperty( "y" )... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestAStar.java |
3,525 | {
@Override
public Double getCost( Node node, Node goal )
{
return ((Double)node.getProperty( "estimate" ));
}
}; | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestAStar.java |
3,526 | {
@Override
public Iterable<Relationship> expand( Path path, BranchState<Double> state )
{
double newState = state.getState();
if ( path.length() > 0 )
{
newState += (Double) path.lastRelationship().getProper... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestAStar.java |
3,527 | @RunWith( Parameterized.class )
public class TestAStar extends Neo4jAlgoTestCase
{
@Test
public void wikipediaExample() throws Exception
{
/* GIVEN
*
* (start)---2--->(d)
* \ \
* 1.5 .\
* v 3
* (a... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestAStar.java |
3,528 | {
@Override
public Double getCost( Node node, Node goal )
{
return 1D;
}
}; | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_PathExplosionIT.java |
3,529 | {
@Override
public Double getCost( Relationship relationship, Direction direction )
{
return 1D;
}
}; | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_PathExplosionIT.java |
3,530 | @Ignore( "Not a test, merely a performance measurement. Convert into a proper performance benchmark at some point" )
public class PathExplosionIT
{
private static final boolean FIND_MULTIPLE_PATHS = false;
private static final int MIN_PATH_LENGTH = 2;
private static final int MAX_PATH_LENGTH = 10;
priva... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_PathExplosionIT.java |
3,531 | private static class PositionedNode
{
private final long node;
private final double x, y;
PositionedNode( long node, double x, double y )
{
this.node = node;
this.x = x;
this.y = y;
}
public double distanceTo( PositionedNode o... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_GeoDataGenerator.java |
3,532 | private class Grid
{
private final int cellsX, cellsY;
private final double sizeX, sizeY;
private final Cell[][] cells;
private final Map<String, Object> nodePropertyScratchMap = new HashMap<String, Object>();
private final Map<String, Object> relationshipPropertyScratchM... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_GeoDataGenerator.java |
3,533 | private static class FlatEstimateEvaluator implements EstimateEvaluator<Double>
{
private double[] cachedGoal;
@Override
public Double getCost( Node node, Node goal )
{
if ( cachedGoal == null )
{
cachedGoal = new double[] {
... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_GeoDataGenerator.java |
3,534 | private static class Cell
{
private final List<PositionedNode> nodes = new ArrayList<PositionedNode>();
void add( PositionedNode node )
{
nodes.add( node );
}
PositionedNode get( Random random )
{
return nodes.get( random.nextInt( nodes.s... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_GeoDataGenerator.java |
3,535 | public class GeoDataGenerator
{
private final Random random = new Random();
private final int numberOfNodes;
private final int numberOfConnections;
private final int width, height;
private int maxDistance = 3;
private double neighborConnectionFactor = 0.6;
public GeoDataGenerator( int numbe... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_GeoDataGenerator.java |
3,536 | public class DijkstraTest extends Neo4jAlgoTestCase
{
@Test
public void canGetPathsInTriangleGraph() throws Exception
{
Node nodeA = graph.makeNode( "A" );
Node nodeB = graph.makeNode( "B" );
Node nodeC = graph.makeNode( "C" );
graph.makeEdge( "A", "B", "length", 2d );
... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_DijkstraTest.java |
3,537 | @Ignore( "Not a test, just nice to have" )
public class AStarPerformanceIT
{
private static final boolean REBUILD = true;
private final File directory;
public AStarPerformanceIT()
{
if (REBUILD)
{
directory = forTest( getClass() ).cleanDirectory( "graph-db" );
}
... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_AStarPerformanceIT.java |
3,538 | public class WeightedPathImpl implements WeightedPath
{
private final Path path;
private final double weight;
public WeightedPathImpl( CostEvaluator<Double> costEvaluator, Path path )
{
this.path = path;
double cost = 0;
for ( Relationship relationship : path.relationships() )
... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_WeightedPathImpl.java |
3,539 | public class TestPriorityMap
{
@Test
public void testIt()
{
PriorityMap<Integer, Integer, Double> map =
PriorityMap.<Integer, Double>withSelfKeyNaturalOrder();
map.put( 0, 5d );
map.put( 1, 4d );
map.put( 1, 4d );
map.put( 1, 3d );
assertEntry( map... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_impl_util_TestPriorityMap.java |
3,540 | public class StopAfterWeightIterator extends PrefetchingIterator<WeightedPath>
{
private final Iterator<Path> paths;
private final CostEvaluator<Double> costEvaluator;
private Double foundWeight;
public StopAfterWeightIterator( Iterator<Path> paths,
CostEvaluator<Double> costEvaluator )... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_StopAfterWeightIterator.java |
3,541 | private static class Node<E, P>
{
Link<E> head;
final P priority;
Node( E entity, P priority )
{
this.head = new Link<E>( entity, null );
this.priority = priority;
}
} | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_PriorityMap.java |
3,542 | public class TestAllSimplePaths extends Neo4jAlgoTestCase
{
protected PathFinder<Path> instantiatePathFinder( int maxDepth )
{
return GraphAlgoFactory.allSimplePaths( Traversal.expanderForAllTypes(), maxDepth );
}
@Test
public void testCircularGraph()
{
/* Layout
*
... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestAllSimplePaths.java |
3,543 | {
@Override
public Iterable<Relationship> expand( Path path, BranchState<Integer> state )
{
if ( path.length() > 0 )
{
int newState = state.getState() + ((Number)path.lastRelationship().getProperty( "weight" )).intValue();
... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestDijkstra.java |
3,544 | private static class Link<E>
{
final E entity;
final Link<E> next;
Link( E entity, Link<E> next )
{
this.entity = entity;
this.next = next;
}
} | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_PriorityMap.java |
3,545 | public class TestExactDepthPathFinder extends Neo4jAlgoTestCase
{
@Before
public void createGraph()
{
graph.makeEdgeChain( "SOURCE,a,b,TARGET" );
graph.makeEdgeChain( "SOURCE,SUPER,c,d" );
graph.makeEdgeChain( "SUPER,e,f" );
graph.makeEdgeChain( "SUPER,g,h,i,j,SPIDER" );
... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestExactDepthPathFinder.java |
3,546 | private static class LengthCheckingExpanderWrapper implements PathExpander<Object> {
private PathExpander expander;
LengthCheckingExpanderWrapper( PathExpander expander )
{
this.expander = expander;
}
@Override
@SuppressWarnings("uncheck... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestShortestPath.java |
3,547 | {
@Override
public void test( PathFinder<Path> finder )
{
assertPaths( finder.findAllPaths( graph.getNode( "a" ), graph.getNode( "c" ) ) );
assertPaths( finder.findAllPaths( graph.getNode( "a" ), graph.getNode( "d" ) ) );
}
... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestShortestPath.java |
3,548 | {
@Override
public void test( PathFinder<Path> finder )
{
assertPaths( finder.findAllPaths( graph.getNode( "a" ), graph.getNode( "b" ) ) );
}
}, Traversal.emptyExpander(), 0 ); | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestShortestPath.java |
3,549 | {
@Override
public void test( PathFinder<Path> finder )
{
assertPaths( finder.findAllPaths( a, d ), "a,g,h,d" );
}
}, Traversal.expanderForAllTypes().addNodeFilter( filter ), 10 ); | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestShortestPath.java |
3,550 | {
@Override
public boolean accept( Node item )
{
boolean skip = (Boolean) item.getProperty( "skip", false );
return !skip;
}
}; | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestShortestPath.java |
3,551 | {
@Override
public void test( PathFinder<Path> finder )
{
Node a = graph.getNode( "a" );
Node e = graph.getNode( "e" );
assertPaths( finder.findAllPaths( a, e ), "a,b,c,e", "a,b,c,e" );
}
}, expanderForTypes(... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestShortestPath.java |
3,552 | {
@Override
public void test( PathFinder<Path> finder )
{
assertPaths( finder.findAllPaths( graph.getNode( "a" ), graph.getNode( "j" ) ), "a,g,h,i,j" );
}
}, expanderForTypes( R1, OUTGOING ), 4 ); | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestShortestPath.java |
3,553 | {
@Override
public void test( PathFinder<Path> finder )
{
assertPaths( finder.findAllPaths( graph.getNode( "s" ), graph.getNode( "t" ) ),
"s,1,2,t", "s,1,4,t", "s,3,2,t", "s,3,4,t" );
}
}, expanderForTypes( R1, BOTH ... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestShortestPath.java |
3,554 | {
@Override
public void test( PathFinder<Path> finder )
{
Iterable<Path> paths = finder.findAllPaths( graph.getNode( "s" ), graph.getNode( "t" ) );
assertPaths( paths, "s,m,o,t", "s,n,o,t" );
}
}, expanderForTypes( R1, BOTH ... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestShortestPath.java |
3,555 | {
@Override
public void test( PathFinder<Path> finder )
{
assertPathDef( finder.findSinglePath( c, a ), "c", "a" );
}
}, expanderForTypes( R1, INCOMING ), 2 ); | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestShortestPath.java |
3,556 | {
@Override
public void test( PathFinder<Path> finder )
{
assertPathDef( finder.findSinglePath( a, c ), "a", "c" );
}
}, expanderForTypes( R1, OUTGOING ), 2 ); | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestShortestPath.java |
3,557 | {
@Override
public void test( PathFinder<Path> finder )
{
assertEquals( count, count( finder.findAllPaths( a, e ) ) );
}
}, expander, 10, count ); | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestShortestPath.java |
3,558 | {
@Override
public void test( PathFinder<Path> finder )
{
assertEquals( 4, count( finder.findAllPaths( a, e ) ) );
}
}, expander, 10, 10 ); | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestShortestPath.java |
3,559 | {
@Override
public void test( PathFinder<Path> finder )
{
assertPaths( finder.findAllPaths( graph.getNode( "m" ), graph.getNode( "p" ) ), "m,s,n,p", "m,o,n,p" );
}
}, expanderForTypes( R1, BOTH ), 3 ); | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestShortestPath.java |
3,560 | {
@Override
public void test( PathFinder<Path> finder )
{
Node start = graph.getNode( "a" );
Node end = graph.getNode( "i" );
assertPaths( finder.findAllPaths( start, end ), "a,b,c,d,e,f,g,i", "a,b,c,d,e,f,h,i" );
}... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestShortestPath.java |
3,561 | {
@Override
protected Collection<Node> filterNextLevelNodes( Collection<Node> nextNodes )
{
for ( Node node : nextNodes )
{
if ( !allowedNodes.contains( node ) )
{
fail( "Node " + ... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestShortestPath.java |
3,562 | {
@Override
public void test( PathFinder<Path> finder )
{
assertPaths( finder.findAllPaths( graph.getNode( "a" ), graph.getNode( "d" ) ) );
assertPaths( finder.findAllPaths( graph.getNode( "a" ), graph.getNode( "e" ) ) );
}
... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestShortestPath.java |
3,563 | {
@Override
public void test( PathFinder<Path> finder )
{
Iterable<Path> paths = finder.findAllPaths( graph.getNode( "s" ), graph.getNode( "t" ) );
assertPaths( paths, "s,t", "s,t" );
assertPaths( asList( finder.findSinglePath( ... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestShortestPath.java |
3,564 | public class TestShortestPath extends Neo4jAlgoTestCase
{
// protected PathFinder<Path> instantiatePathFinder( int maxDepth )
// {
// return instantiatePathFinder( Traversal.expanderForTypes( MyRelTypes.R1,
// Direction.BOTH ), maxDepth );
// }
//
// protected PathFinder<Path> inst... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_path_TestShortestPath.java |
3,565 | private static class NaturalPriority<P extends Comparable<P>> implements
Comparator<P>
{
private final boolean reversed;
NaturalPriority( boolean reversed )
{
this.reversed = reversed;
}
@Override
public int compare( P o1, P o2 )
... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_PriorityMap.java |
3,566 | public static final class Entry<E, P>
{
private final E entity;
private final P priority;
private Entry( E entity, P priority )
{
this.entity = entity;
this.priority = priority;
}
Entry( Node<E, P> node )
{
this( node.... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_PriorityMap.java |
3,567 | public class LuceneLabelScanStoreChaosIT
{
@Test
public void shouldRebuildDeletedLabelScanStoreOnStartup() throws Exception
{
// GIVEN
Node node1 = createLabeledNode( Labels.First );
Node node2 = createLabeledNode( Labels.First );
Node node3 = createLabeledNode( Labels.First ... | false | community_lucene-index_src_test_java_org_neo4j_graphdb_LuceneLabelScanStoreChaosIT.java |
3,568 | public class FibonacciHeapNode
{
FibonacciHeapNode left, right, parent, child;
boolean marked = false;
KeyType key;
int degree = 0;
public FibonacciHeapNode( KeyType key )
{
super();
this.key = key;
left = this;
rig... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_FibonacciHeap.java |
3,569 | public class DoubleEvaluatorWithDefault implements CostEvaluator<Double>
{
private String costPropertyName;
private final double defaultCost;
public DoubleEvaluatorWithDefault( String costPropertyName, double defaultCost )
{
super();
this.costPropertyName = costPropertyName;
thi... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_DoubleEvaluatorWithDefault.java |
3,570 | public class DoubleEvaluator implements CostEvaluator<Double>
{
private String costpropertyName;
public DoubleEvaluator( String costpropertyName )
{
super();
this.costpropertyName = costpropertyName;
}
public Double getCost( Relationship relationship, Direction direction )
{
... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_DoubleEvaluator.java |
3,571 | public class DoubleComparator implements Comparator<Double>
{
public int compare(Double o1, Double o2) {
Double d = o1 - o2;
return d > 0 ? 1 : (d < 0 ? -1 : 0);
}
} | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_DoubleComparator.java |
3,572 | public class DoubleAdder implements CostAccumulator<Double>
{
public Double addCosts(Double c1, Double c2) {
return c1 + c2;
}
} | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_DoubleAdder.java |
3,573 | private static class Visit<P extends Comparable<P>> implements Comparable<P>
{
private P cost;
private boolean visited;
public Visit( P cost )
{
this.cost = cost;
}
@Override
public int compareTo( P o )
{
return cost.compa... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_BestFirstSelectorFactory.java |
3,574 | public final class BestFirstSelector implements BranchSelector
{
private final PriorityMap<TraversalBranch, Node, P> queue =
PriorityMap.withNaturalOrder( CONVERTER );
private TraversalBranch current;
private P currentAggregatedValue;
private final PathExpander ex... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_BestFirstSelectorFactory.java |
3,575 | {
@Override
public Node convert( TraversalBranch source )
{
return source.endNode();
}
}; | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_BestFirstSelectorFactory.java |
3,576 | {
@Override
public Boolean apply( Visit<P> from1, P from2 )
{
return from1.compareTo( from2 ) > 0;
}
}; | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_BestFirstSelectorFactory.java |
3,577 | {
@Override
public Boolean apply( Visit<P> from1, P from2 )
{
return from1.compareTo( from2 ) >= 0;
}
} | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_BestFirstSelectorFactory.java |
3,578 | public abstract class BestFirstSelectorFactory<P extends Comparable<P>, D>
implements BranchOrderingPolicy
{
private final Function2<Visit<P>, P, Boolean> interestPredicate;
public BestFirstSelectorFactory( boolean forMultiplePaths )
{
// If we are interested in multiple paths then we must ... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_BestFirstSelectorFactory.java |
3,579 | public static class PathCounter
{
Map<Node,List<Relationship>> predecessors;
Map<Node,Integer> pathCounts = new HashMap<Node,Integer>();
public PathCounter( Map<Node,List<Relationship>> predecessors )
{
super();
this.predecessors = predecessors;
}... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_shortestpath_Util.java |
3,580 | public class Util
{
/**
* Constructs a path to a given node, for a given set of predecessors
* @param node
* The start node
* @param predecessors
* The predecessors set
* @param includeNode
* Boolean which determines if the start node should be inc... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_shortestpath_Util.java |
3,581 | public class SingleSourceShortestPathDijkstra<CostType> extends
Dijkstra<CostType> implements SingleSourceShortestPath<CostType>
{
DijstraIterator dijstraIterator;
/**
* @see Dijkstra
*/
public SingleSourceShortestPathDijkstra( CostType startCost,
Node startNode, CostEvaluator<CostTyp... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_shortestpath_SingleSourceShortestPathDijkstra.java |
3,582 | public class SingleSourceShortestPathBFS implements
SingleSourceShortestPath<Integer>
{
protected Node startNode;
protected Direction relationShipDirection;
protected RelationshipType[] relationShipTypes;
protected HashMap<Node,Integer> distances = new HashMap<Node,Integer>();;
protected HashMap... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_shortestpath_SingleSourceShortestPathBFS.java |
3,583 | public class FloydWarshall<CostType>
{
protected CostType startCost; // starting cost for all nodes
protected CostType infinitelyBad; // starting value for calculation
protected Direction relationDirection;
protected CostEvaluator<CostType> costEvaluator = null;
protected CostAccumulator<CostType> c... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_shortestpath_FloydWarshall.java |
3,584 | protected class pathObject
{
private Node node;
private CostType cost;
public pathObject( Node node, CostType cost )
{
this.node = node;
this.cost = cost;
}
public CostType getCost()
{
return cost;
}
p... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_shortestpath_DijkstraPriorityQueueImpl.java |
3,585 | {
public int compare( pathObject o1, pathObject o2 )
{
return costComparator.compare( o1.getCost(), o2.getCost() );
}
} ); | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_shortestpath_DijkstraPriorityQueueImpl.java |
3,586 | public class DijkstraPriorityQueueImpl<CostType> implements
DijkstraPriorityQueue<CostType>
{
/**
* Data structure used for the internal priority queue
*/
protected class pathObject
{
private Node node;
private CostType cost;
public pathObject( Node node, CostType cost... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_shortestpath_DijkstraPriorityQueueImpl.java |
3,587 | protected class HeapObject
{
private Node node;
private CostType cost;
public HeapObject( Node node, CostType cost )
{
this.node = node;
this.cost = cost;
}
public CostType getCost()
{
return cost;
}
p... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_shortestpath_DijkstraPriorityQueueFibonacciImpl.java |
3,588 | public class FibonacciHeap<KeyType>
{
/**
* One entry in the fibonacci heap is stored as an instance of this class.
* References to such entries are required for some operations, like
* decreaseKey().
*/
public class FibonacciHeapNode
{
FibonacciHeapNode left, right, parent, chil... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_FibonacciHeap.java |
3,589 | public class GeoEstimateEvaluator implements EstimateEvaluator<Double>
{
private static final double EARTH_RADIUS = 6371*1000; // Meters
private Node cachedGoal;
private double[] cachedGoalCoordinates;
private final String latitudePropertyKey;
private final String longitudePropertyKey;
... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_GeoEstimateEvaluator.java |
3,590 | {
@Override
public int compare( Node<E, P> o1, Node<E, P> o2 )
{
return order.compare( o1.priority, o2.priority );
}
} ); | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_PriorityMap.java |
3,591 | public class IntegerAdder implements CostAccumulator<Integer>
{
public Integer addCosts(Integer c1, Integer c2) {
return c1 + c2;
}
} | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_IntegerAdder.java |
3,592 | {
@Override
public Object convert( Object source )
{
return source;
}
}; | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_PriorityMap.java |
3,593 | public class PriorityMap<E, K, P>
{
public interface Converter<T, S>
{
T convert( S source );
}
public static final class Entry<E, P>
{
private final E entity;
private final P priority;
private Entry( E entity, P priority )
{
this.entity = entity... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_PriorityMap.java |
3,594 | class MockRelationship extends MockPropertyContainer implements Relationship
{
private final long fromNode;
private final long toNode;
public MockRelationship( long fromNode, long toNode )
{
this.fromNode = fromNode;
this.toNode = toNode;
}
... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_impl_util_PathImplTest.java |
3,595 | class MockPropertyContainer implements PropertyContainer
{
@Override
public GraphDatabaseService getGraphDatabase()
{
return null;
}
@Override
public boolean hasProperty( String key )
{
return false;
}
@Override
... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_impl_util_PathImplTest.java |
3,596 | @SuppressWarnings("deprecation")
class MockNode extends MockPropertyContainer implements Node
{
private final long id;
public MockNode( long id )
{
this.id = id;
}
@Override
public long getId()
{
return id;
}
... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_impl_util_PathImplTest.java |
3,597 | public class PathImplTest
{
@Test
public void pathsWithTheSameContentsShouldBeEqual() throws Exception
{
// Given
Path firstPath = new PathImpl.Builder( node( 1337l ) ).push( rel( 1337l, 7331l ) ).build();
Path secondPath = new PathImpl.Builder( node( 1337l ) ).push( rel( 1337l, 733... | false | community_graph-algo_src_test_java_org_neo4j_graphalgo_impl_util_PathImplTest.java |
3,598 | public static final class Builder
{
private final Builder previous;
private final Node start;
private final Relationship relationship;
private final int size;
public Builder( Node start )
{
if ( start == null )
{
throw new ... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_PathImpl.java |
3,599 | {
Iterator<? extends PropertyContainer> current = nodes().iterator();
Iterator<? extends PropertyContainer> next = relationships().iterator();
public boolean hasNext()
{
return current.hasNext();
}
public PropertyContainer... | false | community_graph-algo_src_main_java_org_neo4j_graphalgo_impl_util_PathImpl.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.