From 599b2354eeddc0edf4119e8464f4d10cbcd06d1c Mon Sep 17 00:00:00 2001 From: ribeaudc <ribeaudc> Date: Wed, 20 Aug 2008 08:15:08 +0000 Subject: [PATCH] [LMS-559] change: - Move all the methods to 'IDataStructureV1_X' interface. SVN: 7979 --- .../systemsx/cisd/bds/DataStructureV1_0.java | 34 ++--------------- .../systemsx/cisd/bds/IDataStructureV1_X.java | 38 ++++++++++++++++++- .../cisd/bds/DataStructureV1_0Test.java | 2 + 3 files changed, 41 insertions(+), 33 deletions(-) diff --git a/bds/source/java/ch/systemsx/cisd/bds/DataStructureV1_0.java b/bds/source/java/ch/systemsx/cisd/bds/DataStructureV1_0.java index 0a9a55193f4..6dcd8838091 100644 --- a/bds/source/java/ch/systemsx/cisd/bds/DataStructureV1_0.java +++ b/bds/source/java/ch/systemsx/cisd/bds/DataStructureV1_0.java @@ -18,6 +18,7 @@ package ch.systemsx.cisd.bds; import java.util.Set; +import ch.rinn.restrictions.Private; import ch.systemsx.cisd.bds.exception.DataStructureException; import ch.systemsx.cisd.bds.handler.ChecksumHandler; import ch.systemsx.cisd.bds.handler.MappingFileHandler; @@ -84,7 +85,8 @@ public class DataStructureV1_0 extends AbstractDataStructure implements IDataStr /** * Returns the directory containing the standardized data. */ - public final IDirectory getStandardData() + @Private + final IDirectory getStandardData() { assertOpenOrCreated(); return Utilities.getOrCreateSubDirectory(getDataDirectory(), DIR_STANDARD); @@ -162,21 +164,12 @@ public class DataStructureV1_0 extends AbstractDataStructure implements IDataStr this.annotations = annotations; } - /** - * Returns the experiment identifier. - * - * @throws DataStructureException if the experiment identifier hasn't be loaded nor hasn't be - * set by {@link #setExperimentIdentifier(ExperimentIdentifier)}. - */ public ExperimentIdentifier getExperimentIdentifier() { assertOpenOrCreated(); return ExperimentIdentifier.loadFrom(getMetaDataDirectory()); } - /** - * Sets the experiment identifier. Overwrites an already set or loaded value. - */ public void setExperimentIdentifier(final ExperimentIdentifier experimentIdentifier) { assert experimentIdentifier != null : "Unspecified experiment identifier"; @@ -184,33 +177,18 @@ public class DataStructureV1_0 extends AbstractDataStructure implements IDataStr experimentIdentifier.saveTo(getMetaDataDirectory()); } - /** - * Returns the date of registration of the experiment. - * - * @throws DataStructureException if the processing type hasn't be loaded nor hasn't be set by - * {@link #setExperimentRegistrationTimestamp(ExperimentRegistrationTimestamp)}. - */ public final ExperimentRegistrationTimestamp getExperimentRegistratorTimestamp() { assertOpenOrCreated(); return ExperimentRegistrationTimestamp.loadFrom(getMetaDataDirectory()); } - /** - * Sets the date of registration of the experiment. - */ public final void setExperimentRegistrationTimestamp(final ExperimentRegistrationTimestamp date) { assertOpenOrCreated(); date.saveTo(getMetaDataDirectory()); } - /** - * Returns the experiment registrator. - * - * @throws DataStructureException if the processing type hasn't be loaded nor hasn't be set by - * {@link #setExperimentRegistrator(ExperimentRegistrator)}. - */ public final ExperimentRegistrator getExperimentRegistrator() { assertOpenOrCreated(); @@ -224,12 +202,6 @@ public class DataStructureV1_0 extends AbstractDataStructure implements IDataStr registrator.saveTo(getMetaDataDirectory()); } - /** - * Returns the sample. - * - * @throws DataStructureException if the sample hasn't be loaded nor hasn't be set by - * {@link #setSample(Sample)}. - */ public Sample getSample() { assertOpenOrCreated(); diff --git a/bds/source/java/ch/systemsx/cisd/bds/IDataStructureV1_X.java b/bds/source/java/ch/systemsx/cisd/bds/IDataStructureV1_X.java index f88ff6b290e..6dd33d505ec 100644 --- a/bds/source/java/ch/systemsx/cisd/bds/IDataStructureV1_X.java +++ b/bds/source/java/ch/systemsx/cisd/bds/IDataStructureV1_X.java @@ -16,6 +16,9 @@ package ch.systemsx.cisd.bds; +import java.util.Set; + +import ch.systemsx.cisd.bds.exception.DataStructureException; import ch.systemsx.cisd.bds.storage.IDirectory; /** @@ -43,6 +46,9 @@ public interface IDataStructureV1_X extends IDataStructure /** * Returns the experiment registrator. + * + * @throws DataStructureException if the processing type hasn't be loaded nor hasn't be set by + * {@link #setExperimentRegistrator(ExperimentRegistrator)}. */ public ExperimentRegistrator getExperimentRegistrator(); @@ -77,10 +83,31 @@ public interface IDataStructureV1_X extends IDataStructure public void addReference(final Reference reference); /** - * Sets the experiment identifier. + * Returns the standard-original mapping. + */ + public Set<Reference> getStandardOriginalMapping(); + + /** + * Sets the experiment identifier. Overwrites an already set or loaded value. */ public void setExperimentIdentifier(final ExperimentIdentifier experimentIdentifier); + /** + * Returns the experiment identifier. + * + * @throws DataStructureException if the experiment identifier hasn't be loaded nor hasn't be + * set by {@link #setExperimentIdentifier(ExperimentIdentifier)}. + */ + public ExperimentIdentifier getExperimentIdentifier(); + + /** + * Returns the date of registration of the experiment. + * + * @throws DataStructureException if the processing type hasn't be loaded nor hasn't be set by + * {@link #setExperimentRegistrationTimestamp(ExperimentRegistrationTimestamp)}. + */ + public ExperimentRegistrationTimestamp getExperimentRegistratorTimestamp(); + /** * Sets the experiment registration timestamp. */ @@ -88,8 +115,15 @@ public interface IDataStructureV1_X extends IDataStructure final ExperimentRegistrationTimestamp experimentRegistrationTimestamp); /** - * Sets the sample. + * Sets the measurement entity. Overwrites an already set or loaded value. */ public void setSample(final Sample sample); + /** + * Returns the sample. + * + * @throws DataStructureException if the sample hasn't be loaded nor hasn't be set by + * {@link #setSample(Sample)}. + */ + public Sample getSample(); } diff --git a/bds/sourceTest/java/ch/systemsx/cisd/bds/DataStructureV1_0Test.java b/bds/sourceTest/java/ch/systemsx/cisd/bds/DataStructureV1_0Test.java index ee4d83f580f..c794072023f 100644 --- a/bds/sourceTest/java/ch/systemsx/cisd/bds/DataStructureV1_0Test.java +++ b/bds/sourceTest/java/ch/systemsx/cisd/bds/DataStructureV1_0Test.java @@ -30,6 +30,7 @@ import java.util.Set; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; +import ch.rinn.restrictions.Friend; import ch.systemsx.cisd.bds.exception.DataStructureException; import ch.systemsx.cisd.bds.exception.StorageException; import ch.systemsx.cisd.bds.handler.ChecksumHandler; @@ -44,6 +45,7 @@ import ch.systemsx.cisd.common.filesystem.AbstractFileSystemTestCase; * * @author Franz-Josef Elmer */ +@Friend(toClasses = DataStructureV1_0.class) public final class DataStructureV1_0Test extends AbstractFileSystemTestCase { private static void assertPartOfString(final String part, final String string) -- GitLab