Rename classes & packages
This commit is contained in:
parent
f7a2398a75
commit
202eec3547
@ -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 */
|
||||
|
@ -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){
|
@ -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
|
@ -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
|
@ -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
|
Loading…
Reference in New Issue
Block a user