Skip to content
Snippets Groups Projects
Commit a4d78567 authored by ribeaudc's avatar ribeaudc
Browse files

fix: - It should not be possible to get an instance of 'Geometry'. Only its...

fix: - It should not be possible to get an instance of 'Geometry'. Only its subclasses implements 'getDirectoryName'.

SVN: 5676
parent 3edbefb5
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,7 @@ public class Geometry implements IStorable
private final int columns;
protected Geometry(final int rows, final int columns)
Geometry(final int rows, final int columns)
{
assert columns > 0 : String.format(NOT_POSITIVE, "columns", columns);
this.columns = columns;
......@@ -82,7 +82,7 @@ public class Geometry implements IStorable
* @param toString the output you get when calling {@link #toString()}.
* @return <code>null</code> if operation fails.
*/
public final static Geometry createFromString(final String toString)
static Geometry createFromString(final String toString)
{
assert toString != null : "Given string can not be null.";
final int index = toString.indexOf(X);
......
......@@ -50,7 +50,15 @@ public final class PlateGeometry extends Geometry
*/
final static Geometry loadFrom(final IDirectory directory)
{
return loadFrom(directory, PLATE_GEOMETRY);
return new PlateGeometry(loadFrom(directory, PLATE_GEOMETRY));
}
/**
* Creates a new <code>WellGeometry</code> from given <var>toString</var>.
*/
public final static Geometry createFromString(final String toString)
{
return new PlateGeometry(Geometry.createFromString(toString));
}
//
......
......@@ -50,7 +50,15 @@ public final class WellGeometry extends Geometry
*/
final static Geometry loadFrom(final IDirectory directory)
{
return loadFrom(directory, WELL_GEOMETRY);
return new WellGeometry(loadFrom(directory, WELL_GEOMETRY));
}
/**
* Creates a new <code>WellGeometry</code> from given <var>toString</var>.
*/
public final static Geometry createFromString(final String toString)
{
return new WellGeometry(Geometry.createFromString(toString));
}
//
......
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