@Test public void testScanDefault() { final Kam kam = createTestKAM(); final PathFinder pathFinder = new BasicPathFinder(kam); SimplePath[] pathsFound = pathFinder.scan(kam.findNode("abundance(22)")); assertNotNull(pathsFound); assertEquals(7, pathsFound.length); assertEquals(kam.findNode("abundance(22)"), pathsFound[0].getSource()); assertEquals(kam.findNode("geneAbundance(23)"), pathsFound[0].getTarget()); assertEquals(kam.findNode("abundance(22)"), pathsFound[1].getSource()); assertEquals(kam.findNode("geneAbundance(23)"), pathsFound[1].getTarget()); assertEquals(kam.findNode("abundance(22)"), pathsFound[2].getSource()); assertEquals( kam.findNode("compositeAbundance(abundance(22),abundance(29))"), pathsFound[2].getTarget()); assertEquals(kam.findNode("abundance(22)"), pathsFound[3].getSource()); assertEquals(kam.findNode("geneAbundance(28)"), pathsFound[3].getTarget()); assertEquals(kam.findNode("abundance(22)"), pathsFound[4].getSource()); assertEquals(kam.findNode("abundance(29)"), pathsFound[4].getTarget()); assertEquals(kam.findNode("abundance(22)"), pathsFound[5].getSource()); assertEquals( kam.findNode("complexAbundance(abundance(22),proteinAbundance(28))"), pathsFound[5].getTarget()); assertEquals(kam.findNode("abundance(22)"), pathsFound[6].getSource()); assertEquals(kam.findNode("rnaAbundance(28)"), pathsFound[6].getTarget()); }
@Override public SimplePath[] scan(KamNode source) { if (source == null) { throw new InvalidArgument("Source kam node cannot be null."); } if (!kam.contains(source)) { throw new InvalidArgument("Source does not exist in KAM."); } final List<SimplePath> pathsFound = runDepthFirstScan(kam, source); return pathsFound.toArray(new SimplePath[pathsFound.size()]); }
BasicPathFinder implements PathFinder { @Override public SimplePath[] scan(KamNode source) { if (source == null) { throw new InvalidArgument("Source kam node cannot be null."); } if (!kam.contains(source)) { throw new InvalidArgument("Source does not exist in KAM."); } final List<SimplePath> pathsFound = runDepthFirstScan(kam, source); return pathsFound.toArray(new SimplePath[pathsFound.size()]); } }
BasicPathFinder implements PathFinder { @Override public SimplePath[] scan(KamNode source) { if (source == null) { throw new InvalidArgument("Source kam node cannot be null."); } if (!kam.contains(source)) { throw new InvalidArgument("Source does not exist in KAM."); } final List<SimplePath> pathsFound = runDepthFirstScan(kam, source); return pathsFound.toArray(new SimplePath[pathsFound.size()]); } BasicPathFinder(final Kam kam);  BasicPathFinder(final Kam kam, final int maxSearchDepth); }
BasicPathFinder implements PathFinder { @Override public SimplePath[] scan(KamNode source) { if (source == null) { throw new InvalidArgument("Source kam node cannot be null."); } if (!kam.contains(source)) { throw new InvalidArgument("Source does not exist in KAM."); } final List<SimplePath> pathsFound = runDepthFirstScan(kam, source); return pathsFound.toArray(new SimplePath[pathsFound.size()]); } BasicPathFinder(final Kam kam);  BasicPathFinder(final Kam kam, final int maxSearchDepth); @Override SimplePath[] findPaths(KamNode source, KamNode target); @Override SimplePath[] findPaths(KamNode[] sources, KamNode[] targets); @Override SimplePath[] interconnect(KamNode[] sources); @Override SimplePath[] scan(KamNode source); @Override SimplePath[] scan(KamNode[] sources); }
BasicPathFinder implements PathFinder { @Override public SimplePath[] scan(KamNode source) { if (source == null) { throw new InvalidArgument("Source kam node cannot be null."); } if (!kam.contains(source)) { throw new InvalidArgument("Source does not exist in KAM."); } final List<SimplePath> pathsFound = runDepthFirstScan(kam, source); return pathsFound.toArray(new SimplePath[pathsFound.size()]); } BasicPathFinder(final Kam kam);  BasicPathFinder(final Kam kam, final int maxSearchDepth); @Override SimplePath[] findPaths(KamNode source, KamNode target); @Override SimplePath[] findPaths(KamNode[] sources, KamNode[] targets); @Override SimplePath[] interconnect(KamNode[] sources); @Override SimplePath[] scan(KamNode source); @Override SimplePath[] scan(KamNode[] sources); final static int DEFAULT_MAX_SEARCH_DEPTH; }