Expose source and sinks from the pipeline.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 27 May 2013 13:50:28 +0000 (15:50 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 27 May 2013 20:54:40 +0000 (22:54 +0200)
src/main/java/net/pterodactylus/sonitus/data/Pipeline.java

index 4e6a457..9464f23 100644 (file)
@@ -71,6 +71,32 @@ public class Pipeline {
        }
 
        //
+       // ACCESSORS
+       //
+
+       /**
+        * Expose this pipeline’s source.
+        *
+        * @return This pipeline’s source
+        */
+       public Source source() {
+               return source;
+       }
+
+       /**
+        * Returns all {@link Sink}s (or {@link Filter}s, really) that are connected to
+        * the given source.
+        *
+        * @param source
+        *              The source to get the sinks for
+        * @return The sinks connected to the given source, or an empty list if the
+        *         source does not exist in this pipeline
+        */
+       public Collection<Sink> sinks(Source source) {
+               return sinks.get(source);
+       }
+
+       //
        // ACTIONS
        //