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

declared all stages as final, where possible

parent 1983a690
No related branches found
No related tags found
No related merge requests found
Showing
with 20 additions and 20 deletions
...@@ -20,7 +20,7 @@ import java.nio.charset.Charset; ...@@ -20,7 +20,7 @@ import java.nio.charset.Charset;
import teetime.framework.AbstractConsumerStage; import teetime.framework.AbstractConsumerStage;
import teetime.framework.OutputPort; import teetime.framework.OutputPort;
public class ByteArray2String extends AbstractConsumerStage<byte[]> { public final class ByteArray2String extends AbstractConsumerStage<byte[]> {
private final OutputPort<String> outputPort = this.createOutputPort(); private final OutputPort<String> outputPort = this.createOutputPort();
......
...@@ -23,7 +23,7 @@ import teetime.framework.AbstractConsumerStage; ...@@ -23,7 +23,7 @@ import teetime.framework.AbstractConsumerStage;
import teetime.framework.OutputPort; import teetime.framework.OutputPort;
import teetime.util.StopWatch; import teetime.util.StopWatch;
public class Cache<T> extends AbstractConsumerStage<T> { public final class Cache<T> extends AbstractConsumerStage<T> {
private final OutputPort<T> outputPort = this.createOutputPort(); private final OutputPort<T> outputPort = this.createOutputPort();
......
...@@ -30,7 +30,7 @@ import javax.crypto.spec.SecretKeySpec; ...@@ -30,7 +30,7 @@ import javax.crypto.spec.SecretKeySpec;
import teetime.framework.AbstractConsumerStage; import teetime.framework.AbstractConsumerStage;
import teetime.framework.OutputPort; import teetime.framework.OutputPort;
public class CipherByteArray extends AbstractConsumerStage<byte[]> { public final class CipherByteArray extends AbstractConsumerStage<byte[]> {
private final OutputPort<byte[]> outputPort = this.createOutputPort(); private final OutputPort<byte[]> outputPort = this.createOutputPort();
private Cipher cipher = null; private Cipher cipher = null;
......
...@@ -18,7 +18,7 @@ package teetime.stage; ...@@ -18,7 +18,7 @@ package teetime.stage;
import teetime.framework.AbstractProducerStage; import teetime.framework.AbstractProducerStage;
import teetime.framework.TerminationStrategy; import teetime.framework.TerminationStrategy;
public class Clock extends AbstractProducerStage<Long> { public final class Clock extends AbstractProducerStage<Long> {
private boolean initialDelayExceeded = false; private boolean initialDelayExceeded = false;
......
...@@ -18,7 +18,7 @@ package teetime.stage; ...@@ -18,7 +18,7 @@ package teetime.stage;
import teetime.framework.AbstractConsumerStage; import teetime.framework.AbstractConsumerStage;
import teetime.framework.OutputPort; import teetime.framework.OutputPort;
public class Counter<T> extends AbstractConsumerStage<T> { public final class Counter<T> extends AbstractConsumerStage<T> {
private final OutputPort<T> outputPort = this.createOutputPort(); private final OutputPort<T> outputPort = this.createOutputPort();
......
...@@ -34,7 +34,7 @@ import teetime.stage.util.CountingMap; ...@@ -34,7 +34,7 @@ import teetime.stage.util.CountingMap;
* @param <T> * @param <T>
* Key type of the map to be sent * Key type of the map to be sent
*/ */
public class CountingMapMerger<T> extends AbstractConsumerStage<CountingMap<T>> { public final class CountingMapMerger<T> extends AbstractConsumerStage<CountingMap<T>> {
private final CountingMap<T> result = new CountingMap<T>(); private final CountingMap<T> result = new CountingMap<T>();
private final OutputPort<Map<T, Integer>> port = createOutputPort(); private final OutputPort<Map<T, Integer>> port = createOutputPort();
......
...@@ -22,7 +22,7 @@ import teetime.framework.AbstractConsumerStage; ...@@ -22,7 +22,7 @@ import teetime.framework.AbstractConsumerStage;
import teetime.framework.InputPort; import teetime.framework.InputPort;
import teetime.framework.OutputPort; import teetime.framework.OutputPort;
public class ElementDelayMeasuringStage<T> extends AbstractConsumerStage<T> { public final class ElementDelayMeasuringStage<T> extends AbstractConsumerStage<T> {
private final InputPort<Long> triggerInputPort = this.createInputPort(); private final InputPort<Long> triggerInputPort = this.createInputPort();
private final OutputPort<T> outputPort = this.createOutputPort(); private final OutputPort<T> outputPort = this.createOutputPort();
......
...@@ -23,7 +23,7 @@ import teetime.framework.AbstractConsumerStage; ...@@ -23,7 +23,7 @@ import teetime.framework.AbstractConsumerStage;
import teetime.framework.InputPort; import teetime.framework.InputPort;
import teetime.framework.OutputPort; import teetime.framework.OutputPort;
public class ElementThroughputMeasuringStage<T> extends AbstractConsumerStage<T> { public final class ElementThroughputMeasuringStage<T> extends AbstractConsumerStage<T> {
private final InputPort<Long> triggerInputPort = this.createInputPort(); private final InputPort<Long> triggerInputPort = this.createInputPort();
private final OutputPort<T> outputPort = this.createOutputPort(); private final OutputPort<T> outputPort = this.createOutputPort();
......
...@@ -17,7 +17,7 @@ package teetime.stage; ...@@ -17,7 +17,7 @@ package teetime.stage;
import teetime.framework.AbstractProducerStage; import teetime.framework.AbstractProducerStage;
public class InitialElementProducer<T> extends AbstractProducerStage<T> { public final class InitialElementProducer<T> extends AbstractProducerStage<T> {
private final T[] elements; private final T[] elements;
......
...@@ -30,7 +30,7 @@ import teetime.stage.util.CountingMap; ...@@ -30,7 +30,7 @@ import teetime.stage.util.CountingMap;
* @param <T> * @param <T>
* Type to be count * Type to be count
*/ */
public class MappingCounter<T> extends AbstractConsumerStage<T> { public final class MappingCounter<T> extends AbstractConsumerStage<T> {
private final CountingMap<T> counter = new CountingMap<T>(); private final CountingMap<T> counter = new CountingMap<T>();
private final OutputPort<CountingMap<T>> port = createOutputPort(); private final OutputPort<CountingMap<T>> port = createOutputPort();
......
...@@ -26,7 +26,7 @@ import teetime.framework.OutputPort; ...@@ -26,7 +26,7 @@ import teetime.framework.OutputPort;
* @param T * @param T
* the type of the input port and the output ports * the type of the input port and the output ports
*/ */
public class Distributor<T> extends AbstractConsumerStage<T> { public final class Distributor<T> extends AbstractConsumerStage<T> {
private IDistributorStrategy strategy; private IDistributorStrategy strategy;
......
...@@ -23,7 +23,7 @@ import teetime.framework.AbstractConsumerStage; ...@@ -23,7 +23,7 @@ import teetime.framework.AbstractConsumerStage;
import com.google.common.io.Files; import com.google.common.io.Files;
public class ByteArrayFileWriter extends AbstractConsumerStage<byte[]> { public final class ByteArrayFileWriter extends AbstractConsumerStage<byte[]> {
private final File file; private final File file;
private FileOutputStream fo; private FileOutputStream fo;
......
...@@ -28,7 +28,7 @@ import teetime.framework.OutputPort; ...@@ -28,7 +28,7 @@ import teetime.framework.OutputPort;
* *
* @since 1.10 * @since 1.10
*/ */
public class Directory2FilesFilter extends AbstractConsumerStage<File> { public final class Directory2FilesFilter extends AbstractConsumerStage<File> {
private final OutputPort<File> outputPort = this.createOutputPort(); private final OutputPort<File> outputPort = this.createOutputPort();
......
...@@ -23,7 +23,7 @@ import teetime.framework.OutputPort; ...@@ -23,7 +23,7 @@ import teetime.framework.OutputPort;
import com.google.common.io.Files; import com.google.common.io.Files;
public class File2ByteArray extends AbstractConsumerStage<File> { public final class File2ByteArray extends AbstractConsumerStage<File> {
private final OutputPort<byte[]> outputPort = this.createOutputPort(); private final OutputPort<byte[]> outputPort = this.createOutputPort();
......
...@@ -30,7 +30,7 @@ import teetime.stage.util.TextLine; ...@@ -30,7 +30,7 @@ import teetime.stage.util.TextLine;
* @author Christian Wulf * @author Christian Wulf
* *
*/ */
public class File2TextLinesFilter extends AbstractConsumerStage<File> { public final class File2TextLinesFilter extends AbstractConsumerStage<File> {
private final OutputPort<TextLine> outputPort = this.createOutputPort(); private final OutputPort<TextLine> outputPort = this.createOutputPort();
......
...@@ -29,7 +29,7 @@ import teetime.framework.AbstractConsumerStage; ...@@ -29,7 +29,7 @@ import teetime.framework.AbstractConsumerStage;
* *
* @since 1.10 * @since 1.10
*/ */
public class Printer<T> extends AbstractConsumerStage<T> { public final class Printer<T> extends AbstractConsumerStage<T> {
public static final String STREAM_STDOUT = "STDOUT"; public static final String STREAM_STDOUT = "STDOUT";
public static final String STREAM_STDERR = "STDERR"; public static final String STREAM_STDERR = "STDERR";
......
...@@ -27,7 +27,7 @@ import teetime.framework.OutputPort; ...@@ -27,7 +27,7 @@ import teetime.framework.OutputPort;
* @author Nelson Tavares de Sousa * @author Nelson Tavares de Sousa
* *
*/ */
public class ToLowerCase extends AbstractConsumerStage<String> { public final class ToLowerCase extends AbstractConsumerStage<String> {
private final OutputPort<String> outputPort = this.createOutputPort(); private final OutputPort<String> outputPort = this.createOutputPort();
......
...@@ -34,7 +34,7 @@ import teetime.stage.util.CountingMap; ...@@ -34,7 +34,7 @@ import teetime.stage.util.CountingMap;
* @author Nelson Tavares de Sousa * @author Nelson Tavares de Sousa
* *
*/ */
public class WordCounter extends CompositeStage { public final class WordCounter extends CompositeStage {
// This fields are needed for the methods to work. // This fields are needed for the methods to work.
private final Tokenizer tokenizer = new Tokenizer(" "); private final Tokenizer tokenizer = new Tokenizer(" ");
......
...@@ -28,7 +28,7 @@ import java.util.HashMap; ...@@ -28,7 +28,7 @@ import java.util.HashMap;
* @param <T> * @param <T>
* Key type to be count * Key type to be count
*/ */
public class CountingMap<T> extends HashMap<T, Integer> { public final class CountingMap<T> extends HashMap<T, Integer> {
/** /**
* Generated serialVersionUID * Generated serialVersionUID
......
...@@ -20,7 +20,7 @@ package teetime.stage.util; ...@@ -20,7 +20,7 @@ package teetime.stage.util;
* *
* @since 1.10 * @since 1.10
*/ */
public class MappingException extends Exception { public final class MappingException extends Exception {
private static final long serialVersionUID = 7300752837946139350L; private static final long serialVersionUID = 7300752837946139350L;
......
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