Skip to content
Snippets Groups Projects
Commit 2851ddb8 authored by Scott Langum Du Plessis's avatar Scott Langum Du Plessis
Browse files

Merge branch 'implement-filehandler' into 'Development'

Added toString methods to some classes and fixed minor issues so that the file handler works

See merge request !34
parents 03efeaea fa05137e
No related branches found
No related tags found
2 merge requests!40Development,!34Added toString methods to some classes and fixed minor issues so that the file handler works
Pipeline #288141 failed with stages
in 27 seconds
...@@ -46,7 +46,7 @@ public class ChaosGameDescription { ...@@ -46,7 +46,7 @@ public class ChaosGameDescription {
StringBuilder info = new StringBuilder(); StringBuilder info = new StringBuilder();
if (transforms.get(0) instanceof AffineTransform2D) { if (transforms.get(0) instanceof AffineTransform2D) {
info.append("Affine\n"); info.append("Affine2D\n");
} else if (transforms.get(0) instanceof JuliaTransform) { } else if (transforms.get(0) instanceof JuliaTransform) {
info.append("Julia\n"); info.append("Julia\n");
} else { } else {
......
...@@ -38,4 +38,9 @@ public class AffineTransform2D implements Transform2D { ...@@ -38,4 +38,9 @@ public class AffineTransform2D implements Transform2D {
return result.add(vector); return result.add(vector);
} }
@Override
public String toString() {
return matrix.toString() + ", " + vector.toString();
}
} }
...@@ -55,6 +55,11 @@ public class JuliaTransform implements Transform2D { ...@@ -55,6 +55,11 @@ public class JuliaTransform implements Transform2D {
return new Complex(sign * newComplexPoint.getX0(), sign * newComplexPoint.getX1()); return new Complex(sign * newComplexPoint.getX0(), sign * newComplexPoint.getX1());
} }
@Override
public String toString() {
return constantPoint.toString();
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) { if (this == o) {
......
...@@ -43,4 +43,9 @@ public class Matrix2x2 { ...@@ -43,4 +43,9 @@ public class Matrix2x2 {
return new Vector2D(a00 * vector.getX0() + a01 * vector.getX1(), a10 return new Vector2D(a00 * vector.getX0() + a01 * vector.getX1(), a10
* vector.getX0() + a11 * vector.getX1()); * vector.getX0() + a11 * vector.getX1());
} }
@Override
public String toString() {
return a00 + ", " + a01 + ", " + a10 + ", " + a11;
}
} }
...@@ -16,4 +16,7 @@ public interface Transform2D { ...@@ -16,4 +16,7 @@ public interface Transform2D {
* @return The transformed vector. * @return The transformed vector.
*/ */
Vector2D transform(Vector2D point); Vector2D transform(Vector2D point);
@Override
String toString();
} }
\ No newline at end of file
...@@ -68,6 +68,10 @@ public class Vector2D { ...@@ -68,6 +68,10 @@ public class Vector2D {
return new Vector2D(newX0, newX1); return new Vector2D(newX0, newX1);
} }
@Override
public String toString() {
return x0 + ", " + x1;
}
/** /**
* Checks if the parameter {@code o} is equal to this instance of {@code Vector2D}. * Checks if the parameter {@code o} is equal to this instance of {@code Vector2D}.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment