From 78786d4f9016374863dba9478ec7dd13fb47929e Mon Sep 17 00:00:00 2001 From: Andrea Burattin <andrea.burattin@gmail.com> Date: Sat, 26 Mar 2022 22:19:50 +0100 Subject: [PATCH] Completed javadoc --- .../sources/BeamlineAbstractSource.java | 11 +++++++--- .../java/beamline/sources/CSVLogSource.java | 4 ++-- .../java/beamline/sources/MQTTXesSource.java | 3 +-- .../beamline/sources/StringTestSource.java | 20 +++++++++++++++++++ 4 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/main/java/beamline/sources/BeamlineAbstractSource.java b/src/main/java/beamline/sources/BeamlineAbstractSource.java index 2e660c3..2a8a858 100644 --- a/src/main/java/beamline/sources/BeamlineAbstractSource.java +++ b/src/main/java/beamline/sources/BeamlineAbstractSource.java @@ -5,9 +5,14 @@ import org.apache.flink.streaming.api.functions.source.RichSourceFunction; import beamline.events.BEvent; /** - * This interface is supposed to bind the type of {@link RichSourceFunction} to - * {@link BEvent} and to provide minimal infrastructure to check if the sourece - * is currently running. + * This class represents the general source to generate {@link BEvent}s. The + * goal of the class is to bind the type of the underlying + * {@link RichSourceFunction} to {@link BEvent} as well as provide basic + * management for running/not running. + * + * <p> + * Since the source is a "rich" one, it means that it is possible to access the + * state from within all sources derived from this one. * * @author Andrea Burattin */ diff --git a/src/main/java/beamline/sources/CSVLogSource.java b/src/main/java/beamline/sources/CSVLogSource.java index 050045f..a580b61 100644 --- a/src/main/java/beamline/sources/CSVLogSource.java +++ b/src/main/java/beamline/sources/CSVLogSource.java @@ -20,8 +20,8 @@ import beamline.events.BEvent; import beamline.exceptions.SourceException; /** - * This implementation of a {@link BeamlineAbstractSource} produces events - * according to the events contained in a CSV file. + * This implementation of a {@link BeamlineAbstractSource} produces + * {@link BEvent} according to the rows contained in a CSV file. * * @author Andrea Burattin */ diff --git a/src/main/java/beamline/sources/MQTTXesSource.java b/src/main/java/beamline/sources/MQTTXesSource.java index d81fdb8..bdad323 100644 --- a/src/main/java/beamline/sources/MQTTXesSource.java +++ b/src/main/java/beamline/sources/MQTTXesSource.java @@ -22,8 +22,7 @@ import beamline.exceptions.SourceException; * <p> * Example of usage: * <pre> - * XesSource source = new MQTTXesSource("tcp://broker.hivemq.com:1883", "topicBase", "processName"); - * source.prepare(); + * MQTTXesSource source = new MQTTXesSource("tcp://broker.hivemq.com:1883", "topicBase", "processName"); * </pre> * * <p> diff --git a/src/main/java/beamline/sources/StringTestSource.java b/src/main/java/beamline/sources/StringTestSource.java index 65c317d..9fec5dc 100644 --- a/src/main/java/beamline/sources/StringTestSource.java +++ b/src/main/java/beamline/sources/StringTestSource.java @@ -2,11 +2,31 @@ package beamline.sources; import beamline.events.BEvent; +/** + * Source useful for designing new algorithm. It allows to specify sequences of + * events directly in the constructor. + * + * <p> + * Example of usage: + * <pre> + * StringTestSource s = new StringTestSource("ABC", "ADCE"); + * </pre> + * This is going to emit 7 events as part of 2 traces. Each trace is a string + * provided in the constructor and each event is one character of the string. + * + * @author Andrea Burattin + */ public class StringTestSource extends BeamlineAbstractSource { private static final long serialVersionUID = 7657971352128040279L; private String[] traces; + /** + * Constructs the source by providing the strings representing the events to + * emit + * + * @param traces one string for each trace, where each character is an event + */ public StringTestSource(String...traces) { this.traces = traces; } -- GitLab