Skip to content
Snippets Groups Projects
Commit 4ac7bb22 authored by brinn's avatar brinn
Browse files

minor: fix typos

SVN: 2192
parent 10d9cd90
No related branches found
No related tags found
No related merge requests found
...@@ -68,7 +68,7 @@ public class DataStructureV1_0 extends AbstractDataStructure ...@@ -68,7 +68,7 @@ public class DataStructureV1_0 extends AbstractDataStructure
* *
* @throws UserFailureException if this method has been invoked before the format has been set. * @throws UserFailureException if this method has been invoked before the format has been set.
*/ */
public IFormatedData getFormatedData() public IFormattedData getFormatedData()
{ {
if (format == null) if (format == null)
{ {
...@@ -141,7 +141,7 @@ public class DataStructureV1_0 extends AbstractDataStructure ...@@ -141,7 +141,7 @@ public class DataStructureV1_0 extends AbstractDataStructure
{ {
if (getOriginalData().iterator().hasNext() == false) if (getOriginalData().iterator().hasNext() == false)
{ {
throw new UserFailureException("Empty orginal data directory."); throw new UserFailureException("Empty original data directory.");
} }
IDirectory metaDataDirectory = getMetaDataDirectory(); IDirectory metaDataDirectory = getMetaDataDirectory();
if (metaDataDirectory.tryToGetNode(Format.FORMAT_DIR) == null) if (metaDataDirectory.tryToGetNode(Format.FORMAT_DIR) == null)
......
...@@ -24,58 +24,58 @@ import ch.systemsx.cisd.common.exceptions.UserFailureException; ...@@ -24,58 +24,58 @@ import ch.systemsx.cisd.common.exceptions.UserFailureException;
/** /**
* Factory for objects of type {@link IFormatedData}. * Factory for objects of type {@link IFormattedData}.
* *
* @author Franz-Josef Elmer * @author Franz-Josef Elmer
*/ */
class FormatedDataFactory class FormatedDataFactory
{ {
private static final Map<String, Factory<IFormatedData>> factories = new HashMap<String, Factory<IFormatedData>>(); private static final Map<String, Factory<IFormattedData>> factories = new HashMap<String, Factory<IFormattedData>>();
static static
{ {
register(UnknownFormat1_0.UNKNOWN_1_0, NoFormatedData.class); register(UnknownFormat1_0.UNKNOWN_1_0, NoFormattedData.class);
} }
static void register(Format format, Class<? extends IFormatedData> clazz) static void register(Format format, Class<? extends IFormattedData> clazz)
{ {
String code = format.getCode(); String code = format.getCode();
Factory<IFormatedData> factory = factories.get(code); Factory<IFormattedData> factory = factories.get(code);
if (factory == null) if (factory == null)
{ {
factory = new Factory<IFormatedData>(); factory = new Factory<IFormattedData>();
factories.put(code, factory); factories.put(code, factory);
} }
factory.register(format.getVersion(), clazz); factory.register(format.getVersion(), clazz);
} }
static Class<? extends IFormatedData> getFormatedDataInterfaceFor(Format format, Format defaultFormat) static Class<? extends IFormattedData> getFormatedDataInterfaceFor(Format format, Format defaultFormat)
{ {
Factory<IFormatedData> factory = getFactory(format, defaultFormat); Factory<IFormattedData> factory = getFactory(format, defaultFormat);
return factory.getClassFor(format.getVersion()); return factory.getClassFor(format.getVersion());
} }
static IFormatedData createFormatedData(IDirectory dataDirectory, Format format, Format defaultFormat) static IFormattedData createFormatedData(IDirectory dataDirectory, Format format, Format defaultFormat)
{ {
Factory<IFormatedData> factory = getFactory(format, defaultFormat); Factory<IFormattedData> factory = getFactory(format, defaultFormat);
return factory.create(IDirectory.class, dataDirectory, format.getVersion()); return factory.create(IDirectory.class, dataDirectory, format.getVersion());
} }
private static Factory<IFormatedData> getFactory(Format format, Format defaultFormat) private static Factory<IFormattedData> getFactory(Format format, Format defaultFormat)
{ {
assert format != null : "Unspecified format."; assert format != null : "Unspecified format.";
String code = format.getCode(); String code = format.getCode();
assert code != null : "Unspecified format code."; assert code != null : "Unspecified format code.";
assert format.getVersion() != null : "Unspecified version."; assert format.getVersion() != null : "Unspecified version.";
Factory<IFormatedData> factory = factories.get(code); Factory<IFormattedData> factory = factories.get(code);
if (factory == null) if (factory == null)
{ {
if (defaultFormat != null) if (defaultFormat != null)
{ {
return getFactory(defaultFormat, null); return getFactory(defaultFormat, null);
} }
throw new UserFailureException("Unkown format code: " + code); throw new UserFailureException("Unknown format code: " + code);
} }
return factory; return factory;
} }
......
...@@ -21,7 +21,7 @@ package ch.systemsx.cisd.bds; ...@@ -21,7 +21,7 @@ package ch.systemsx.cisd.bds;
* *
* @author Franz-Josef Elmer * @author Franz-Josef Elmer
*/ */
public interface IFormatedData public interface IFormattedData
{ {
/** /**
* Returns the format of data. * Returns the format of data.
......
...@@ -19,12 +19,12 @@ package ch.systemsx.cisd.bds; ...@@ -19,12 +19,12 @@ package ch.systemsx.cisd.bds;
import ch.systemsx.cisd.bds.storage.IDirectory; import ch.systemsx.cisd.bds.storage.IDirectory;
/** /**
* Most simplest implementation of {@link IFormatedData}. It is associated with {@link UnknownFormat1_0}. * Most simplest implementation of {@link IFormattedData}. It is associated with {@link UnknownFormat1_0}.
* It can be subclassed provided {@link #getFormat()} will be overridden. * It can be subclassed provided {@link #getFormat()} will be overridden.
* *
* @author Franz-Josef Elmer * @author Franz-Josef Elmer
*/ */
public class NoFormatedData implements IFormatedData public class NoFormattedData implements IFormattedData
{ {
/** /**
* Root directory of formated data. * Root directory of formated data.
...@@ -34,7 +34,7 @@ public class NoFormatedData implements IFormatedData ...@@ -34,7 +34,7 @@ public class NoFormatedData implements IFormatedData
/** /**
* Creates an instance for the specified data directory. * Creates an instance for the specified data directory.
*/ */
public NoFormatedData(IDirectory dataDirectory) public NoFormattedData(IDirectory dataDirectory)
{ {
this.dataDirectory = dataDirectory; this.dataDirectory = dataDirectory;
} }
......
...@@ -70,8 +70,8 @@ public class DataStructureV1_0Test ...@@ -70,8 +70,8 @@ public class DataStructureV1_0Test
public void testGetFormatedData() public void testGetFormatedData()
{ {
dataStructure.setFormat(UnknownFormat1_0.UNKNOWN_1_0); dataStructure.setFormat(UnknownFormat1_0.UNKNOWN_1_0);
IFormatedData formatedData = dataStructure.getFormatedData(); IFormattedData formatedData = dataStructure.getFormatedData();
assertTrue(formatedData instanceof NoFormatedData); assertTrue(formatedData instanceof NoFormattedData);
assertEquals(UnknownFormat1_0.UNKNOWN_1_0, formatedData.getFormat()); assertEquals(UnknownFormat1_0.UNKNOWN_1_0, formatedData.getFormat());
} }
......
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