From 202eec3547a2ddbcd195728ddddede3df393b86b Mon Sep 17 00:00:00 2001 From: Mark Vainomaa Date: Sun, 26 Mar 2017 17:55:05 +0300 Subject: [PATCH] Rename classes & packages --- .../mikroskeem/uurimustoo/algoritmidetest/Utils.java | 12 ++++++------ .../AbstractAlgorithm.java} | 4 ++-- .../CompressGZip.java => algoritmid/GZip.java} | 4 ++-- .../CompressXZ.java => algoritmid/XZ.java} | 4 ++-- .../CompressZip.java => algoritmid/Zip.java} | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) rename src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/{compressors/AbstractCompressor.java => algoritmid/AbstractAlgorithm.java} (94%) rename src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/{compressors/CompressGZip.java => algoritmid/GZip.java} (83%) rename src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/{compressors/CompressXZ.java => algoritmid/XZ.java} (85%) rename src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/{compressors/CompressZip.java => algoritmid/Zip.java} (93%) diff --git a/src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/Utils.java b/src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/Utils.java index 7656058..c1c2621 100644 --- a/src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/Utils.java +++ b/src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/Utils.java @@ -2,7 +2,7 @@ package eu.mikroskeem.uurimustoo.algoritmidetest; import eu.mikroskeem.shuriken.instrumentation.validate.Validate; import eu.mikroskeem.shuriken.reflect.Reflect; -import eu.mikroskeem.uurimustoo.algoritmidetest.compressors.AbstractCompressor; +import eu.mikroskeem.uurimustoo.algoritmidetest.algoritmid.AbstractAlgorithm; import io.github.lukehutch.fastclasspathscanner.FastClasspathScanner; import lombok.Getter; import lombok.RequiredArgsConstructor; @@ -17,13 +17,13 @@ import java.util.stream.Collectors; * @author Mark Vainomaa */ public class Utils { - public static List getAllCompressors(){ - return new FastClasspathScanner(AbstractCompressor.class.getPackage().getName()) - .scan().getNamesOfSubclassesOf(AbstractCompressor.class) + public static List getAllCompressors(){ + return new FastClasspathScanner(AbstractAlgorithm.class.getPackage().getName()) + .scan().getNamesOfSubclassesOf(AbstractAlgorithm.class) .stream() .map(className -> { try { - return (AbstractCompressor)Reflect.getClass(className) + return (AbstractAlgorithm)Reflect.getClass(className) .get().construct().getClassInstance(); } catch (Exception e){ return null; @@ -34,7 +34,7 @@ public class Utils { } - public static CompressorResult executeCompressor(byte[] input, AbstractCompressor compressor){ + public static CompressorResult executeCompressor(byte[] input, AbstractAlgorithm compressor){ String compressorName = compressor.getName(); byte[] compressed = compressor.compress(input); /* Verify for sure */ diff --git a/src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/compressors/AbstractCompressor.java b/src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/algoritmid/AbstractAlgorithm.java similarity index 94% rename from src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/compressors/AbstractCompressor.java rename to src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/algoritmid/AbstractAlgorithm.java index 78a04eb..fb8248d 100644 --- a/src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/compressors/AbstractCompressor.java +++ b/src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/algoritmid/AbstractAlgorithm.java @@ -1,4 +1,4 @@ -package eu.mikroskeem.uurimustoo.algoritmidetest.compressors; +package eu.mikroskeem.uurimustoo.algoritmidetest.algoritmid; import eu.mikroskeem.shuriken.common.SneakyThrow; @@ -7,7 +7,7 @@ import java.io.*; /** * @author Mark Vainomaa */ -public abstract class AbstractCompressor { +public abstract class AbstractAlgorithm { public abstract String getName(); public final byte[] compress(byte[] input){ diff --git a/src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/compressors/CompressGZip.java b/src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/algoritmid/GZip.java similarity index 83% rename from src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/compressors/CompressGZip.java rename to src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/algoritmid/GZip.java index 9b8edba..6187514 100644 --- a/src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/compressors/CompressGZip.java +++ b/src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/algoritmid/GZip.java @@ -1,4 +1,4 @@ -package eu.mikroskeem.uurimustoo.algoritmidetest.compressors; +package eu.mikroskeem.uurimustoo.algoritmidetest.algoritmid; import lombok.Getter; @@ -11,7 +11,7 @@ import java.util.zip.GZIPOutputStream; /** * @author Mark Vainomaa */ -public class CompressGZip extends AbstractCompressor { +public class GZip extends AbstractAlgorithm { @Getter private final String name = "GZip"; @Override diff --git a/src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/compressors/CompressXZ.java b/src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/algoritmid/XZ.java similarity index 85% rename from src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/compressors/CompressXZ.java rename to src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/algoritmid/XZ.java index 77c97e5..e37a8c7 100644 --- a/src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/compressors/CompressXZ.java +++ b/src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/algoritmid/XZ.java @@ -1,4 +1,4 @@ -package eu.mikroskeem.uurimustoo.algoritmidetest.compressors; +package eu.mikroskeem.uurimustoo.algoritmidetest.algoritmid; import lombok.Getter; import org.tukaani.xz.LZMA2Options; @@ -12,7 +12,7 @@ import java.io.OutputStream; /** * @author Mark Vainomaa */ -public class CompressXZ extends AbstractCompressor { +public class XZ extends AbstractAlgorithm { @Getter private final String name = "XZ"; @Override diff --git a/src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/compressors/CompressZip.java b/src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/algoritmid/Zip.java similarity index 93% rename from src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/compressors/CompressZip.java rename to src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/algoritmid/Zip.java index e61c9e4..11ada5d 100644 --- a/src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/compressors/CompressZip.java +++ b/src/main/java/eu/mikroskeem/uurimustoo/algoritmidetest/algoritmid/Zip.java @@ -1,4 +1,4 @@ -package eu.mikroskeem.uurimustoo.algoritmidetest.compressors; +package eu.mikroskeem.uurimustoo.algoritmidetest.algoritmid; import lombok.Getter; @@ -12,7 +12,7 @@ import java.util.zip.ZipOutputStream; /** * @author Mark Vainomaa */ -public class CompressZip extends AbstractCompressor { +public class Zip extends AbstractAlgorithm { @Getter private final String name = "ZIP"; @Override