Skip to content
Snippets Groups Projects
Commit 1cb0af33 authored by Nelson Tavares de Sousa's avatar Nelson Tavares de Sousa
Browse files

#70 all classes are declared as final, where possible

parent 86ee2116
No related branches found
No related tags found
No related merge requests found
Showing
with 40 additions and 14 deletions
...@@ -35,7 +35,7 @@ import teetime.util.Pair; ...@@ -35,7 +35,7 @@ import teetime.util.Pair;
* To start the analysis {@link #init()} and {@link #start()} need to be executed in this order. * To start the analysis {@link #init()} and {@link #start()} need to be executed in this order.
* This class will automatically create threads and join them without any further commitment. * This class will automatically create threads and join them without any further commitment.
*/ */
public class Analysis implements UncaughtExceptionHandler { public final class Analysis implements UncaughtExceptionHandler {
private static final Logger LOGGER = LoggerFactory.getLogger(Analysis.class); private static final Logger LOGGER = LoggerFactory.getLogger(Analysis.class);
......
...@@ -24,7 +24,7 @@ import teetime.framework.pipe.PipeFactoryRegistry; ...@@ -24,7 +24,7 @@ import teetime.framework.pipe.PipeFactoryRegistry;
* Represents a configuration of connected stages, which is needed to run a analysis. * Represents a configuration of connected stages, which is needed to run a analysis.
* Stages can be added by executing {@link #addThreadableStage(Stage)}. * Stages can be added by executing {@link #addThreadableStage(Stage)}.
*/ */
public class AnalysisConfiguration { public abstract class AnalysisConfiguration {
protected static final PipeFactoryRegistry PIPE_FACTORY_REGISTRY = PipeFactoryRegistry.INSTANCE; protected static final PipeFactoryRegistry PIPE_FACTORY_REGISTRY = PipeFactoryRegistry.INSTANCE;
private final List<Stage> threadableStageJobs = new LinkedList<Stage>(); private final List<Stage> threadableStageJobs = new LinkedList<Stage>();
......
...@@ -20,7 +20,7 @@ import teetime.framework.OutputPort; ...@@ -20,7 +20,7 @@ import teetime.framework.OutputPort;
import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering;
import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication;
public class CommittablePipeFactory implements IPipeFactory { public final class CommittablePipeFactory implements IPipeFactory {
@Override @Override
public <T> IPipe create(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort) { public <T> IPipe create(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort) {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
*/ */
package teetime.framework.pipe; package teetime.framework.pipe;
public class CouldNotFindPipeImplException extends RuntimeException { public final class CouldNotFindPipeImplException extends RuntimeException {
private static final long serialVersionUID = 5242260988104493402L; private static final long serialVersionUID = 5242260988104493402L;
......
...@@ -20,7 +20,7 @@ import teetime.framework.OutputPort; ...@@ -20,7 +20,7 @@ import teetime.framework.OutputPort;
import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering;
import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication;
public class OrderedGrowableArrayPipeFactory implements IPipeFactory { public final class OrderedGrowableArrayPipeFactory implements IPipeFactory {
@Override @Override
public <T> IPipe create(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort) { public <T> IPipe create(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort) {
......
...@@ -20,7 +20,7 @@ import teetime.framework.OutputPort; ...@@ -20,7 +20,7 @@ import teetime.framework.OutputPort;
import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering;
import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication;
public class SingleElementPipeFactory implements IPipeFactory { public final class SingleElementPipeFactory implements IPipeFactory {
@Override @Override
public <T> IPipe create(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort) { public <T> IPipe create(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort) {
......
...@@ -20,7 +20,7 @@ import teetime.framework.OutputPort; ...@@ -20,7 +20,7 @@ import teetime.framework.OutputPort;
import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering;
import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication;
public class SpScPipeFactory implements IPipeFactory { public final class SpScPipeFactory implements IPipeFactory {
@Override @Override
public <T> IPipe create(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort) { public <T> IPipe create(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort) {
......
...@@ -20,7 +20,7 @@ import teetime.framework.OutputPort; ...@@ -20,7 +20,7 @@ import teetime.framework.OutputPort;
import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering;
import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication;
public class UnorderedGrowablePipeFactory implements IPipeFactory { public final class UnorderedGrowablePipeFactory implements IPipeFactory {
@Override @Override
public <T> IPipe create(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort) { public <T> IPipe create(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort) {
......
...@@ -23,7 +23,7 @@ import org.slf4j.LoggerFactory; ...@@ -23,7 +23,7 @@ import org.slf4j.LoggerFactory;
import teetime.framework.AbstractStage; import teetime.framework.AbstractStage;
public class StartingSignal implements ISignal { public final class StartingSignal implements ISignal {
private static final Logger LOGGER = LoggerFactory.getLogger(StartingSignal.class); private static final Logger LOGGER = LoggerFactory.getLogger(StartingSignal.class);
private final List<Exception> catchedExceptions = new LinkedList<Exception>(); private final List<Exception> catchedExceptions = new LinkedList<Exception>();
......
...@@ -23,7 +23,7 @@ import org.slf4j.LoggerFactory; ...@@ -23,7 +23,7 @@ import org.slf4j.LoggerFactory;
import teetime.framework.AbstractStage; import teetime.framework.AbstractStage;
public class TerminatingSignal implements ISignal { public final class TerminatingSignal implements ISignal {
private static final Logger LOGGER = LoggerFactory.getLogger(TerminatingSignal.class); private static final Logger LOGGER = LoggerFactory.getLogger(TerminatingSignal.class);
private final List<Exception> catchedExceptions = new LinkedList<Exception>(); private final List<Exception> catchedExceptions = new LinkedList<Exception>();
......
...@@ -21,7 +21,7 @@ import java.util.List; ...@@ -21,7 +21,7 @@ import java.util.List;
import teetime.framework.AbstractStage; import teetime.framework.AbstractStage;
import teetime.framework.validation.InvalidPortConnection; import teetime.framework.validation.InvalidPortConnection;
public class ValidatingSignal implements ISignal { public final class ValidatingSignal implements ISignal {
private final List<InvalidPortConnection> invalidPortConnections = new LinkedList<InvalidPortConnection>(); private final List<InvalidPortConnection> invalidPortConnections = new LinkedList<InvalidPortConnection>();
......
...@@ -15,10 +15,36 @@ ...@@ -15,10 +15,36 @@
*/ */
package teetime.framework.pipe; package teetime.framework.pipe;
public class DummyFactory extends SpScPipeFactory { import teetime.framework.InputPort;
import teetime.framework.OutputPort;
import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering;
import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication;
public DummyFactory() { public final class DummyFactory implements IPipeFactory {
super();
@Override
public <T> IPipe create(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort) {
return this.create(sourcePort, targetPort, 4);
}
@Override
public <T> IPipe create(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort, final int capacity) {
return new SpScPipe(sourcePort, targetPort, capacity);
}
@Override
public ThreadCommunication getThreadCommunication() {
return ThreadCommunication.INTER;
}
@Override
public PipeOrdering getOrdering() {
return PipeOrdering.QUEUE_BASED;
}
@Override
public boolean isGrowable() {
return false;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment