From c25c9b65ebbd33be7bd20802f4de83142eb4bd8e Mon Sep 17 00:00:00 2001
From: langella <langella@b8ef2a07-7df7-436f-90b9-41648038564b>
Date: Wed, 8 Feb 2012 09:42:24 +0000
Subject: [PATCH] new interface for DataSource

git-svn-id: https://subversion.renater.fr/xtandempipeline/trunk@193 b8ef2a07-7df7-436f-90b9-41648038564b
---
 .../IdentificationDataFile.java               | 17 +++++++++--
 .../IdentificationDataSource.java             | 15 ++++++++++
 .../IdentificationMascotFile.java             | 28 +++++++++++++++++++
 .../IdentificationXtandemFile.java            | 18 ++++++++++++
 4 files changed, 76 insertions(+), 2 deletions(-)
 create mode 100644 xtandempipeline/src/fr/inra/pappso/xtandempipeline/class_msms/IdentificationDataFile/IdentificationDataSource.java
 create mode 100644 xtandempipeline/src/fr/inra/pappso/xtandempipeline/class_msms/IdentificationDataFile/IdentificationMascotFile.java

diff --git a/xtandempipeline/src/fr/inra/pappso/xtandempipeline/class_msms/IdentificationDataFile/IdentificationDataFile.java b/xtandempipeline/src/fr/inra/pappso/xtandempipeline/class_msms/IdentificationDataFile/IdentificationDataFile.java
index 4fbaecd42..4bcf4c652 100644
--- a/xtandempipeline/src/fr/inra/pappso/xtandempipeline/class_msms/IdentificationDataFile/IdentificationDataFile.java
+++ b/xtandempipeline/src/fr/inra/pappso/xtandempipeline/class_msms/IdentificationDataFile/IdentificationDataFile.java
@@ -2,8 +2,12 @@ package fr.inra.pappso.xtandempipeline.class_msms.IdentificationDataFile;
 
 import java.io.File;
 
-public class IdentificationDataFile implements
-		Comparable<IdentificationDataFile> {
+import javax.xml.stream.XMLStreamWriter;
+
+import fr.inra.pappso.xtandempipeline.class_msms.Identification;
+
+public abstract class IdentificationDataFile implements
+		Comparable<IdentificationDataFile>, IdentificationDataSource {
 
 	protected File file = null;
 
@@ -12,6 +16,7 @@ public class IdentificationDataFile implements
 		return new IdentificationXtandemFile(file);
 	}
 
+	@Override
 	public String getName() {
 		return this.file.getName();
 	}
@@ -33,4 +38,12 @@ public class IdentificationDataFile implements
 		return this.file.compareTo(toCompare.file);
 	}
 
+	@Override
+	abstract public Identification loadIdentification(
+			Identification previousIdentification);
+
+	@Override
+	abstract public void writeXpipPeptideSourceAttribute(XMLStreamWriter writer)
+			throws Exception;
+
 }
diff --git a/xtandempipeline/src/fr/inra/pappso/xtandempipeline/class_msms/IdentificationDataFile/IdentificationDataSource.java b/xtandempipeline/src/fr/inra/pappso/xtandempipeline/class_msms/IdentificationDataFile/IdentificationDataSource.java
new file mode 100644
index 000000000..7284784db
--- /dev/null
+++ b/xtandempipeline/src/fr/inra/pappso/xtandempipeline/class_msms/IdentificationDataFile/IdentificationDataSource.java
@@ -0,0 +1,15 @@
+package fr.inra.pappso.xtandempipeline.class_msms.IdentificationDataFile;
+
+import javax.xml.stream.XMLStreamWriter;
+
+import fr.inra.pappso.xtandempipeline.class_msms.Identification;
+
+public interface IdentificationDataSource {
+	public String getName();
+
+	public Identification loadIdentification(
+			Identification previousIdentification);
+
+	public void writeXpipPeptideSourceAttribute(XMLStreamWriter writer)
+			throws Exception;
+}
diff --git a/xtandempipeline/src/fr/inra/pappso/xtandempipeline/class_msms/IdentificationDataFile/IdentificationMascotFile.java b/xtandempipeline/src/fr/inra/pappso/xtandempipeline/class_msms/IdentificationDataFile/IdentificationMascotFile.java
new file mode 100644
index 000000000..0ee8abd44
--- /dev/null
+++ b/xtandempipeline/src/fr/inra/pappso/xtandempipeline/class_msms/IdentificationDataFile/IdentificationMascotFile.java
@@ -0,0 +1,28 @@
+package fr.inra.pappso.xtandempipeline.class_msms.IdentificationDataFile;
+
+import java.io.File;
+
+import javax.xml.stream.XMLStreamWriter;
+
+import fr.inra.pappso.xtandempipeline.class_msms.Identification;
+
+public class IdentificationMascotFile extends IdentificationDataFile {
+
+	public IdentificationMascotFile(File mascotFile) {
+		this.file = mascotFile;
+	}
+
+	@Override
+	public Identification loadIdentification(
+			Identification previousIdentification) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void writeXpipPeptideSourceAttribute(XMLStreamWriter writer)
+			throws Exception {
+		// TODO Auto-generated method stub
+		
+	}
+}
diff --git a/xtandempipeline/src/fr/inra/pappso/xtandempipeline/class_msms/IdentificationDataFile/IdentificationXtandemFile.java b/xtandempipeline/src/fr/inra/pappso/xtandempipeline/class_msms/IdentificationDataFile/IdentificationXtandemFile.java
index 3d8603bf9..880ae3092 100644
--- a/xtandempipeline/src/fr/inra/pappso/xtandempipeline/class_msms/IdentificationDataFile/IdentificationXtandemFile.java
+++ b/xtandempipeline/src/fr/inra/pappso/xtandempipeline/class_msms/IdentificationDataFile/IdentificationXtandemFile.java
@@ -2,9 +2,27 @@ package fr.inra.pappso.xtandempipeline.class_msms.IdentificationDataFile;
 
 import java.io.File;
 
+import javax.xml.stream.XMLStreamWriter;
+
+import fr.inra.pappso.xtandempipeline.class_msms.Identification;
+
 public class IdentificationXtandemFile extends IdentificationDataFile {
 
 	public IdentificationXtandemFile (File xtandemFile) {
 		this.file = xtandemFile;
 	}
+
+	@Override
+	public Identification loadIdentification(
+			Identification previousIdentification) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void writeXpipPeptideSourceAttribute(XMLStreamWriter writer)
+			throws Exception {
+		// TODO Auto-generated method stub
+		
+	}
 }
-- 
GitLab