From b50117c63d034d9a945af3d0e007dac0d96e5190 Mon Sep 17 00:00:00 2001 From: dgelessus <dgelessus@users.noreply.github.com> Date: Thu, 24 Aug 2023 15:25:27 +0200 Subject: [PATCH] Remove unused RandomSeed and related code --- de.prob.core/src/de/prob/core/Animator.java | 9 -- .../prob/core/domainobjects/RandomSeed.java | 87 ------------------- .../de/prob/core/internal/AnimatorImpl.java | 11 --- 3 files changed, 107 deletions(-) delete mode 100644 de.prob.core/src/de/prob/core/domainobjects/RandomSeed.java diff --git a/de.prob.core/src/de/prob/core/Animator.java b/de.prob.core/src/de/prob/core/Animator.java index 8311d265..9abaa9de 100644 --- a/de.prob.core/src/de/prob/core/Animator.java +++ b/de.prob.core/src/de/prob/core/Animator.java @@ -14,7 +14,6 @@ import de.prob.core.command.IComposableCommand; import de.prob.core.domainobjects.History; import de.prob.core.domainobjects.MachineDescription; import de.prob.core.domainobjects.Operation; -import de.prob.core.domainobjects.RandomSeed; import de.prob.core.domainobjects.State; import de.prob.core.internal.Activator; import de.prob.core.internal.AnimatorImpl; @@ -206,14 +205,6 @@ public final class Animator { return implementation; } - public final synchronized RandomSeed getRandomSeed() { - return getImplementation().getSeed(); - } - - public final synchronized void setRandomSeed(final RandomSeed seed) { - getImplementation().setSeed(seed); - } - // just for testing private Preferences customConfiguration; diff --git a/de.prob.core/src/de/prob/core/domainobjects/RandomSeed.java b/de.prob.core/src/de/prob/core/domainobjects/RandomSeed.java deleted file mode 100644 index bc6ebb97..00000000 --- a/de.prob.core/src/de/prob/core/domainobjects/RandomSeed.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen, - * Heinrich Heine Universitaet Duesseldorf - * This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html) - * */ - -package de.prob.core.domainobjects; - -import java.math.BigInteger; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public class RandomSeed { - - private final BigInteger[] seed; - - public RandomSeed(final BigInteger x, final BigInteger y, - final BigInteger z, final BigInteger b) { - seed = new BigInteger[] { x, y, z, b }; - } - - public BigInteger getSeedX() { - return seed[0]; - } - - public BigInteger getSeedY() { - return seed[1]; - } - - public BigInteger getSeedZ() { - return seed[2]; - } - - public BigInteger getSeedB() { - return seed[3]; - } - - @Override - public String toString() { - return getSeedX() + ":" + getSeedY() + ":" + getSeedZ() + ":" - + getSeedB(); - } - - public static RandomSeed fromString(final String seed) { - Pattern p = Pattern.compile("(\\d*):(\\d*):(\\d*):(\\d*)"); - Matcher m = p.matcher(seed); - if (!m.matches()) { - throw new IllegalArgumentException("Wrong format"); - } - String[] splitSeed = seed.split(":"); - BigInteger x = new BigInteger(splitSeed[0]); - BigInteger y = new BigInteger(splitSeed[1]); - BigInteger z = new BigInteger(splitSeed[2]); - BigInteger b = new BigInteger(splitSeed[3]); - return new RandomSeed(x, y, z, b); - } - - @Override - public boolean equals(final Object obj) { - if (obj instanceof RandomSeed) { - RandomSeed seed = (RandomSeed) obj; - if (!(seed.getSeedX().equals(this.getSeedX()))) { - return false; - } - if (!(seed.getSeedY().equals(this.getSeedY()))) { - return false; - } - if (!(seed.getSeedZ().equals(this.getSeedZ()))) { - return false; - } - if (!(seed.getSeedB().equals(this.getSeedB()))) { - return false; - } - return true; - } - return false; - } - - @Override - public int hashCode() { - final int xHash = getSeedX().hashCode(); - final int yHash = getSeedY().hashCode(); - final int zHash = getSeedZ().hashCode(); - final int bHash = getSeedB().hashCode(); - return xHash + 11 * yHash + 37 * zHash + 43 * bHash; - } -} diff --git a/de.prob.core/src/de/prob/core/internal/AnimatorImpl.java b/de.prob.core/src/de/prob/core/internal/AnimatorImpl.java index 2df0c76d..dff26da0 100644 --- a/de.prob.core/src/de/prob/core/internal/AnimatorImpl.java +++ b/de.prob.core/src/de/prob/core/internal/AnimatorImpl.java @@ -21,7 +21,6 @@ import de.prob.core.command.IComposableCommand; import de.prob.core.domainobjects.History; import de.prob.core.domainobjects.HistoryItem; import de.prob.core.domainobjects.MachineDescription; -import de.prob.core.domainobjects.RandomSeed; import de.prob.core.domainobjects.State; import de.prob.core.sablecc.node.Start; import de.prob.exceptions.ProBException; @@ -41,8 +40,6 @@ public class AnimatorImpl { private IServerConnection connector; - private RandomSeed seed; - private MachineDescription description; private final File file; @@ -111,14 +108,6 @@ public class AnimatorImpl { return true; } - public void setSeed(final RandomSeed seed) { - this.seed = seed; - } - - public RandomSeed getSeed() { - return seed; - } - public synchronized void setMachineDescription( final MachineDescription machineDescription) { this.description = machineDescription; -- GitLab