Rename classes & packages

This commit is contained in:
Mark Vainomaa 2017-03-26 17:55:05 +03:00
parent f7a2398a75
commit 202eec3547
5 changed files with 14 additions and 14 deletions

View File

@ -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<AbstractCompressor> getAllCompressors(){
return new FastClasspathScanner(AbstractCompressor.class.getPackage().getName())
.scan().getNamesOfSubclassesOf(AbstractCompressor.class)
public static List<AbstractAlgorithm> 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 */

View File

@ -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){

View File

@ -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

View File

@ -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

View File

@ -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