From 213d1e8f6b6c948055d0a7c5bc91115b5d9e8bf5 Mon Sep 17 00:00:00 2001
From: Nelson Tavares de Sousa <stu103017@mail.uni-kiel.de>
Date: Tue, 23 Jun 2015 13:27:47 +0200
Subject: [PATCH] set methods to package private; moved javadoc to the public
 class

---
 .../framework/AbstractCompositeStage.java     | 35 ++++++++++++++++++-
 .../framework/ConfigurationContext.java       | 32 ++---------------
 2 files changed, 36 insertions(+), 31 deletions(-)

diff --git a/src/main/java/teetime/framework/AbstractCompositeStage.java b/src/main/java/teetime/framework/AbstractCompositeStage.java
index d09ed0bb..0ffd7602 100644
--- a/src/main/java/teetime/framework/AbstractCompositeStage.java
+++ b/src/main/java/teetime/framework/AbstractCompositeStage.java
@@ -25,6 +25,11 @@ package teetime.framework;
  */
 public abstract class AbstractCompositeStage {
 
+	/**
+	 * Default capacity for pipes
+	 */
+	private static final int DEFAULT_CAPACITY = 4;
+
 	private final ConfigurationContext context;
 
 	public AbstractCompositeStage(final ConfigurationContext context) {
@@ -38,14 +43,42 @@ public abstract class AbstractCompositeStage {
 		return context;
 	}
 
+	/**
+	 * Execute this method, to add a stage to the configuration, which should be executed in a own thread.
+	 *
+	 * @param stage
+	 *            A arbitrary stage, which will be added to the configuration and executed in a thread.
+	 */
 	protected final void addThreadableStage(final Stage stage) {
 		context.addThreadableStage(stage);
 	}
 
+	/**
+	 * Connects two ports with a pipe with a default capacity of currently {@value #DEFAULT_CAPACITY}.
+	 *
+	 * @param sourcePort
+	 *            {@link OutputPort} of the sending stage
+	 * @param targetPort
+	 *            {@link InputPort} of the sending stage
+	 * @param <T>
+	 *            the type of elements to be sent
+	 */
 	protected final <T> void connectPorts(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort) {
-		context.connectPorts(sourcePort, targetPort);
+		context.connectPorts(sourcePort, targetPort, DEFAULT_CAPACITY);
 	}
 
+	/**
+	 * Connects to ports with a pipe of a certain capacity
+	 *
+	 * @param sourcePort
+	 *            {@link OutputPort} of the sending stage
+	 * @param targetPort
+	 *            {@link InputPort} of the sending stage
+	 * @param capacity
+	 *            the pipe is set to this capacity, if the value is greater than 0. If it is 0, than the pipe is unbounded, thus growing of the pipe is enabled.
+	 * @param <T>
+	 *            the type of elements to be sent
+	 */
 	protected final <T> void connectPorts(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort, final int capacity) {
 		context.connectPorts(sourcePort, targetPort, capacity);
 	}
diff --git a/src/main/java/teetime/framework/ConfigurationContext.java b/src/main/java/teetime/framework/ConfigurationContext.java
index c0dd8103..e0398832 100644
--- a/src/main/java/teetime/framework/ConfigurationContext.java
+++ b/src/main/java/teetime/framework/ConfigurationContext.java
@@ -31,8 +31,6 @@ import teetime.framework.pipe.InstantiationPipe;
  */
 public final class ConfigurationContext {
 
-	private static final int DEFAULT_CAPACITY = 4;
-
 	private static final Logger LOGGER = LoggerFactory.getLogger(ConfigurationContext.class);
 
 	private final Set<Stage> threadableStages = new HashSet<Stage>();
@@ -44,10 +42,7 @@ public final class ConfigurationContext {
 	}
 
 	/**
-	 * Execute this method, to add a stage to the configuration, which should be executed in a own thread.
-	 *
-	 * @param stage
-	 *            A arbitrary stage, which will be added to the configuration and executed in a thread.
+	 * @see AbstractCompositeStage#addThreadableStage(Stage)
 	 */
 	final void addThreadableStage(final Stage stage) {
 		if (!this.threadableStages.add(stage)) {
@@ -56,30 +51,7 @@ public final class ConfigurationContext {
 	}
 
 	/**
-	 * Connects two ports with a pipe with a default capacity of currently {@value #DEFAULT_CAPACITY}.
-	 *
-	 * @param sourcePort
-	 *            {@link OutputPort} of the sending stage
-	 * @param targetPort
-	 *            {@link InputPort} of the sending stage
-	 * @param <T>
-	 *            the type of elements to be sent
-	 */
-	final <T> void connectPorts(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort) {
-		connectPorts(sourcePort, targetPort, DEFAULT_CAPACITY);
-	}
-
-	/**
-	 * Connects to ports with a pipe of a certain capacity
-	 *
-	 * @param sourcePort
-	 *            {@link OutputPort} of the sending stage
-	 * @param targetPort
-	 *            {@link InputPort} of the sending stage
-	 * @param capacity
-	 *            the pipe is set to this capacity, if the value is greater than 0. If it is 0, than the pipe is unbounded, thus growing of the pipe is enabled.
-	 * @param <T>
-	 *            the type of elements to be sent
+	 * @see AbstractCompositeStage#connectPorts(OutputPort, InputPort, int)
 	 */
 	final <T> void connectPorts(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort, final int capacity) {
 		if (sourcePort.getOwningStage().getInputPorts().length == 0 && !threadableStages.contains(sourcePort.getOwningStage())) {
-- 
GitLab