def main()

in cassovary-examples/src/main/scala/HelloLoadSharedGraph.scala [22:45]


  def main(args: Array[String]) {
    val (dir, graphName, graphDirection) = if (args.length > 0) {
      val d = if (args.length >= 3) {
        args(2) match {
          case "BothInOut" => BothInOut
          case "OnlyOut" => OnlyOut
          case "OnlyIn" => OnlyIn
          case s => println(s"Unknown graph direction $s specified. Using OnlyOut !")
            OnlyOut
        }
      } else OnlyOut
      (args(0), args(1), d)
    }
    else {
      ("../cassovary-core/src/test/resources/graphs", "toy_list5edges", OnlyOut)
    }
    val sep = detectGraphFormat(dir, graphName)
    println(s"Will read graph $graphName from directory $dir using separator ${sep.toInt}")

    println(s"\nBuilding shared graph for direction $graphDirection")
    val graph = ListOfEdgesGraphReader.forIntIds(dir, graphName, separator = sep,
      graphDir = graphDirection).toSharedArrayBasedDirectedGraph()
    println(s"A SharedArrayBasedDirectedGraph with ${graph.nodeCount} nodes has ${graph.edgeCount} directed edges.")
  }