add Java graph DSL

This commit is contained in:
Roland Kuhn 2015-02-26 23:41:35 +01:00
parent e870c7cbd2
commit 703fb7891b
3 changed files with 47 additions and 5 deletions

View file

@ -271,7 +271,7 @@ object FlowGraph extends GraphApply {
object Implicits {
@tailrec
private def findOut[I, O](b: Builder, junction: UniformFanOutShape[I, O], n: Int): Outlet[O] = {
private[stream] def findOut[I, O](b: Builder, junction: UniformFanOutShape[I, O], n: Int): Outlet[O] = {
if (n == junction.outArray.length)
throw new IllegalArgumentException(s"no more outlets free on $junction")
else if (b.module.downstreams.contains(junction.out(n))) findOut(b, junction, n + 1)
@ -279,7 +279,7 @@ object FlowGraph extends GraphApply {
}
@tailrec
private def findIn[I, O](b: Builder, junction: UniformFanInShape[I, O], n: Int): Inlet[I] = {
private[stream] def findIn[I, O](b: Builder, junction: UniformFanInShape[I, O], n: Int): Inlet[I] = {
if (n == junction.inArray.length)
throw new IllegalArgumentException(s"no more inlets free on $junction")
else if (b.module.upstreams.contains(junction.in(n))) findIn(b, junction, n + 1)