Skip to content

Commit

Permalink
Renaming variables
Browse files Browse the repository at this point in the history
  • Loading branch information
gr812b committed Dec 23, 2024
1 parent 0cc108b commit d206438
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 37 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mcmasterbaja.analyzer;

import com.mcmasterbaja.model.AnalyzerEnum;
import com.mcmasterbaja.model.AnalyzerType;
import com.mcmasterbaja.model.AnalyzerParams;
import com.opencsv.exceptions.CsvException;
import jakarta.enterprise.context.Dependent;
Expand All @@ -15,7 +15,7 @@
import org.jboss.logging.Logger;

@Dependent
@AnalyzerType(AnalyzerEnum.ACCEL_CURVE)
@AnalyzerTypeQualifier(AnalyzerType.ACCEL_CURVE)
public class AccelCurveAnalyzer extends Analyzer {

@Inject Logger logger;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mcmasterbaja.analyzer;

import com.mcmasterbaja.model.AnalyzerEnum;
import com.mcmasterbaja.model.AnalyzerType;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import org.jboss.logging.Logger;
Expand All @@ -11,46 +11,46 @@ public class AnalyzerFactory {
@Inject Logger logger;

@Inject
@AnalyzerType(AnalyzerEnum.ACCEL_CURVE)
@AnalyzerTypeQualifier(AnalyzerType.ACCEL_CURVE)
Analyzer accelCurveAnalyzer;

@Inject
@AnalyzerType(AnalyzerEnum.AVERAGE)
@AnalyzerTypeQualifier(AnalyzerType.AVERAGE)
Analyzer averageAnalyzer;

@Inject
@AnalyzerType(AnalyzerEnum.CONSTANT_ADDER)
@AnalyzerTypeQualifier(AnalyzerType.CONSTANT_ADDER)
Analyzer constantAdderAnalyzer;

@Inject
@AnalyzerType(AnalyzerEnum.CUBIC)
@AnalyzerTypeQualifier(AnalyzerType.CUBIC)
Analyzer cubicAnalyzer;

@Inject
@AnalyzerType(AnalyzerEnum.INTERPOLATER_PRO)
@AnalyzerTypeQualifier(AnalyzerType.INTERPOLATER_PRO)
Analyzer interpolaterProAnalyzer;

@Inject
@AnalyzerType(AnalyzerEnum.LINEAR_MULTIPLY)
@AnalyzerTypeQualifier(AnalyzerType.LINEAR_MULTIPLY)
Analyzer linearMultiplyAnalyzer;

@Inject
@AnalyzerType(AnalyzerEnum.RDP_COMPRESSION)
@AnalyzerTypeQualifier(AnalyzerType.RDP_COMPRESSION)
Analyzer rdpCompressionAnalyzer;

@Inject
@AnalyzerType(AnalyzerEnum.ROLL_AVG)
@AnalyzerTypeQualifier(AnalyzerType.ROLL_AVG)
Analyzer rollAvgAnalyzer;

@Inject
@AnalyzerType(AnalyzerEnum.SGOLAY)
@AnalyzerTypeQualifier(AnalyzerType.SGOLAY)
Analyzer sgolayAnalyzer;

@Inject
@AnalyzerType(AnalyzerEnum.SPLIT)
@AnalyzerTypeQualifier(AnalyzerType.SPLIT)
Analyzer splitAnalyzer;

public Analyzer createAnalyzer(AnalyzerEnum type) {
public Analyzer createAnalyzer(AnalyzerType type) {
switch (type) {
case ACCEL_CURVE:
return accelCurveAnalyzer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import com.mcmasterbaja.model.AnalyzerEnum;
import com.mcmasterbaja.model.AnalyzerType;
import jakarta.inject.Qualifier;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

@Qualifier
@Retention(RUNTIME)
@Target({TYPE, METHOD, FIELD, PARAMETER})
public @interface AnalyzerType {
AnalyzerEnum value();
public @interface AnalyzerTypeQualifier {
AnalyzerType value();
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mcmasterbaja.analyzer;

import com.mcmasterbaja.model.AnalyzerEnum;
import com.mcmasterbaja.model.AnalyzerType;
import com.mcmasterbaja.model.AnalyzerParams;
import com.opencsv.CSVReader;
import com.opencsv.ICSVWriter;
Expand All @@ -12,7 +12,7 @@
import org.jboss.logging.Logger;

@Dependent
@AnalyzerType(AnalyzerEnum.AVERAGE)
@AnalyzerTypeQualifier(AnalyzerType.AVERAGE)
public class AverageAnalyzer extends Analyzer {
// This class takes the average of a range of a column and returns it as a double
@Inject Logger logger;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mcmasterbaja.analyzer;

import com.mcmasterbaja.model.AnalyzerEnum;
import com.mcmasterbaja.model.AnalyzerType;
import com.mcmasterbaja.model.AnalyzerParams;
import com.opencsv.CSVReader;
import com.opencsv.ICSVWriter;
Expand All @@ -11,7 +11,7 @@
import org.jboss.logging.Logger;

@Dependent
@AnalyzerType(AnalyzerEnum.CONSTANT_ADDER)
@AnalyzerTypeQualifier(AnalyzerType.CONSTANT_ADDER)
public class ConstantAdderAnalyzer extends Analyzer {
private double a;
private double b;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mcmasterbaja.analyzer;

import com.mcmasterbaja.model.AnalyzerEnum;
import com.mcmasterbaja.model.AnalyzerType;
import com.mcmasterbaja.model.AnalyzerParams;
import com.opencsv.CSVReader;
import com.opencsv.ICSVWriter;
Expand All @@ -11,7 +11,7 @@
import org.jboss.logging.Logger;

@Dependent
@AnalyzerType(AnalyzerEnum.CUBIC)
@AnalyzerTypeQualifier(AnalyzerType.CUBIC)
public class CubicAnalyzer extends Analyzer {
// Form of y = ax^3 + bx^2 + cx + d
private double a;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mcmasterbaja.analyzer;

import com.mcmasterbaja.model.AnalyzerEnum;
import com.mcmasterbaja.model.AnalyzerType;
import com.mcmasterbaja.model.AnalyzerParams;
import com.opencsv.CSVReader;
import com.opencsv.ICSVWriter;
Expand All @@ -18,7 +18,7 @@
// file based on the timestamp

@Dependent
@AnalyzerType(AnalyzerEnum.INTERPOLATER_PRO)
@AnalyzerTypeQualifier(AnalyzerType.INTERPOLATER_PRO)
public class InterpolaterProAnalyzer extends Analyzer {

@Inject Logger logger;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mcmasterbaja.analyzer;

import com.mcmasterbaja.model.AnalyzerEnum;
import com.mcmasterbaja.model.AnalyzerType;
import com.mcmasterbaja.model.AnalyzerParams;
import com.opencsv.CSVReader;
import com.opencsv.ICSVWriter;
Expand All @@ -11,7 +11,7 @@
import org.jboss.logging.Logger;

@Dependent
@AnalyzerType(AnalyzerEnum.LINEAR_MULTIPLY)
@AnalyzerTypeQualifier(AnalyzerType.LINEAR_MULTIPLY)
public class LinearMultiplyAnalyzer extends Analyzer {
private double m;
private double b;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mcmasterbaja.analyzer;

import com.mcmasterbaja.model.AnalyzerEnum;
import com.mcmasterbaja.model.AnalyzerType;
import com.mcmasterbaja.model.AnalyzerParams;
import com.opencsv.CSVReader;
import com.opencsv.ICSVWriter;
Expand All @@ -13,7 +13,7 @@
import org.jboss.logging.Logger;

@Dependent
@AnalyzerType(AnalyzerEnum.RDP_COMPRESSION)
@AnalyzerTypeQualifier(AnalyzerType.RDP_COMPRESSION)
public class RDPCompressionAnalyzer extends Analyzer {

// Epsilon is the maximum distance between a point and the line between the start and end points
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mcmasterbaja.analyzer;

import com.mcmasterbaja.model.AnalyzerEnum;
import com.mcmasterbaja.model.AnalyzerType;
import com.mcmasterbaja.model.AnalyzerParams;
import com.opencsv.CSVReader;
import com.opencsv.ICSVWriter;
Expand All @@ -13,7 +13,7 @@
import org.jboss.logging.Logger;

@Dependent
@AnalyzerType(AnalyzerEnum.ROLL_AVG)
@AnalyzerTypeQualifier(AnalyzerType.ROLL_AVG)
public class RollingAvgAnalyzer extends Analyzer {
private int windowSize;
@Inject Logger logger;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mcmasterbaja.analyzer;

import com.mcmasterbaja.model.AnalyzerEnum;
import com.mcmasterbaja.model.AnalyzerType;
import com.mcmasterbaja.model.AnalyzerParams;
import com.opencsv.CSVReader;
import com.opencsv.ICSVWriter;
Expand All @@ -15,7 +15,7 @@
import org.jboss.logging.Logger;

@Dependent
@AnalyzerType(AnalyzerEnum.SGOLAY)
@AnalyzerTypeQualifier(AnalyzerType.SGOLAY)
public class SGolayFilter extends Analyzer {
private int windowSize;
private int polynomialDegree;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mcmasterbaja.analyzer;

import com.mcmasterbaja.model.AnalyzerEnum;
import com.mcmasterbaja.model.AnalyzerType;
import com.mcmasterbaja.model.AnalyzerParams;
import com.opencsv.CSVReader;
import com.opencsv.ICSVWriter;
Expand All @@ -11,7 +11,7 @@
import org.jboss.logging.Logger;

@Dependent
@AnalyzerType(AnalyzerEnum.SPLIT)
@AnalyzerTypeQualifier(AnalyzerType.SPLIT)
public class SplitAnalyzer extends Analyzer {
private int start;
private int end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class AnalyzerParams {
private String[] inputColumns;

@QueryParam("type")
private AnalyzerEnum type;
private AnalyzerType type;

@QueryParam("analyzerOptions")
private String[] options;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mcmasterbaja.model;

public enum AnalyzerEnum {
public enum AnalyzerType {
ACCEL_CURVE,
AVERAGE,
CUBIC,
Expand Down

0 comments on commit d206438

Please sign in to comment.