Package psidev.psi.mi.jami.tab.io.writer
Class AbstractMitab25BinaryWriter<T extends BinaryInteraction,P extends Participant>
- java.lang.Object
-
- psidev.psi.mi.jami.tab.io.writer.AbstractMitab25BinaryWriter<T,P>
-
- All Implemented Interfaces:
InteractionWriter<T>
- Direct Known Subclasses:
AbstractMitab26BinaryWriter,LightMitab25BinaryWriter,Mitab25BinaryEvidenceWriter,Mitab25BinaryEvidenceWriter,Mitab25BinaryWriter,Mitab25ModelledBinaryWriter,Mitab25ModelledBinaryWriter
public abstract class AbstractMitab25BinaryWriter<T extends BinaryInteraction,P extends Participant> extends Object implements InteractionWriter<T>
Abstract class for BinaryInteraction writer.- Since:
19/06/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description AbstractMitab25BinaryWriter()Constructor for AbstractMitab25BinaryWriter.AbstractMitab25BinaryWriter(File file)Constructor for AbstractMitab25BinaryWriter.AbstractMitab25BinaryWriter(OutputStream output)Constructor for AbstractMitab25BinaryWriter.AbstractMitab25BinaryWriter(Writer writer)Constructor for AbstractMitab25BinaryWriter.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()close.voidend()end.voidflush()flush.protected MitabColumnFeeder<T,P>getColumnFeeder()Getter for the fieldcolumnFeeder.MitabVersiongetVersion()Getter for the fieldversion.protected WritergetWriter()Getter for the fieldwriter.protected booleanhasStarted()hasStarted.protected abstract voidinitialiseColumnFeeder()initialiseColumnFeeder.voidinitialiseContext(Map<String,Object> options)Initialise the context of the InteractionWriter given a map of optionsbooleanisWriteHeader()isWriteHeader.voidreset()reset.protected voidsetColumnFeeder(MitabColumnFeeder<T,P> columnFeeder)Setter for the fieldcolumnFeeder.protected voidsetStarted(boolean start)setStarted.protected voidsetVersion(MitabVersion version)Setter for the fieldversion.voidsetWriteHeader(boolean writeHeader)Setter for the fieldwriteHeader.voidstart()start.voidwrite(Collection<? extends T> interactions)Writes a collection of binary interactions.voidwrite(Iterator<? extends T> interactions)Writes Interaction objects using iteratorvoidwrite(T interaction)Writes a binary interaction.protected voidwriteBinary(T interaction, P a, P b)Writes the binary interaction and its participants in MITAB 2.5protected voidwriteHeader()Write the header
-
-
-
Constructor Detail
-
AbstractMitab25BinaryWriter
public AbstractMitab25BinaryWriter()
Constructor for AbstractMitab25BinaryWriter.
-
AbstractMitab25BinaryWriter
public AbstractMitab25BinaryWriter(File file) throws IOException
Constructor for AbstractMitab25BinaryWriter.
- Parameters:
file- aFileobject.- Throws:
IOException- if any.
-
AbstractMitab25BinaryWriter
public AbstractMitab25BinaryWriter(OutputStream output)
Constructor for AbstractMitab25BinaryWriter.
- Parameters:
output- aOutputStreamobject.
-
-
Method Detail
-
getVersion
public MitabVersion getVersion()
Getter for the field
version.- Returns:
- a
MitabVersionobject.
-
isWriteHeader
public boolean isWriteHeader()
isWriteHeader.
- Returns:
- a boolean.
-
setWriteHeader
public void setWriteHeader(boolean writeHeader)
Setter for the field
writeHeader.- Parameters:
writeHeader- a boolean.
-
initialiseContext
public void initialiseContext(Map<String,Object> options)
Initialise the context of the InteractionWriter given a map of options- Specified by:
initialiseContextin interfaceInteractionWriter<T extends BinaryInteraction>- Parameters:
options- : the options given by the user
-
end
public void end() throws MIIOExceptionend.
- Specified by:
endin interfaceInteractionWriter<T extends BinaryInteraction>- Throws:
MIIOException- if any.
-
start
public void start() throws MIIOExceptionstart.
- Specified by:
startin interfaceInteractionWriter<T extends BinaryInteraction>- Throws:
MIIOException- if any.
-
write
public void write(T interaction) throws MIIOException
Writes a binary interaction. Does not write any extended properties from participants, interaction and features This method will write empty columns for interaction detection method, publication author and identifier, source and confidences. It will also ignore experimental roles, host organism, interaction parameters and participant identification methods- Specified by:
writein interfaceInteractionWriter<T extends BinaryInteraction>- Parameters:
interaction- a T object.- Throws:
MIIOException- if any.
-
write
public void write(Collection<? extends T> interactions) throws MIIOException
Writes a collection of binary interactions. Does not write any extended properties from participants, interaction and features This method will write empty columns for interaction detection method, publication author and identifier, source and confidences. It will also ignore experimental roles, host organism, interaction parameters and participant identification methods- Specified by:
writein interfaceInteractionWriter<T extends BinaryInteraction>- Parameters:
interactions- aCollectionobject.- Throws:
MIIOException- if any.
-
write
public void write(Iterator<? extends T> interactions) throws MIIOException
Writes Interaction objects using iterator- Specified by:
writein interfaceInteractionWriter<T extends BinaryInteraction>- Parameters:
interactions- : the iterator of interactions to write- Throws:
MIIOException- : if cannot write
-
flush
public void flush() throws MIIOExceptionflush.
- Specified by:
flushin interfaceInteractionWriter<T extends BinaryInteraction>- Throws:
MIIOException- if any.
-
close
public void close() throws MIIOExceptionclose.
- Specified by:
closein interfaceInteractionWriter<T extends BinaryInteraction>- Throws:
MIIOException- if any.
-
reset
public void reset() throws MIIOExceptionreset.
- Specified by:
resetin interfaceInteractionWriter<T extends BinaryInteraction>- Throws:
MIIOException- if any.
-
getColumnFeeder
protected MitabColumnFeeder<T,P> getColumnFeeder()
Getter for the field
columnFeeder.- Returns:
- a
MitabColumnFeederobject.
-
setColumnFeeder
protected void setColumnFeeder(MitabColumnFeeder<T,P> columnFeeder)
Setter for the field
columnFeeder.- Parameters:
columnFeeder- aMitabColumnFeederobject.
-
initialiseColumnFeeder
protected abstract void initialiseColumnFeeder()
initialiseColumnFeeder.
-
writeBinary
protected void writeBinary(T interaction, P a, P b) throws IOException
Writes the binary interaction and its participants in MITAB 2.5- Parameters:
interaction- a T object.a- a P object.b- a P object.- Throws:
IOException- if any.
-
writeHeader
protected void writeHeader() throws IOExceptionWrite the header- Throws:
IOException- if any.
-
setVersion
protected void setVersion(MitabVersion version)
Setter for the field
version.- Parameters:
version- aMitabVersionobject.
-
hasStarted
protected boolean hasStarted()
hasStarted.
- Returns:
- a boolean.
-
setStarted
protected void setStarted(boolean start)
setStarted.
- Parameters:
start- a boolean.
-
-