Package psidev.psi.mi.jami.json.binary
Class AbstractMIJsonWriter<I extends Interaction,B extends BinaryInteraction>
- java.lang.Object
-
- psidev.psi.mi.jami.json.binary.AbstractMIJsonWriter<I,B>
-
- All Implemented Interfaces:
InteractionWriter<I>
- Direct Known Subclasses:
LightMIJsonWriter,MIJsonEvidenceWriter,MIJsonModelledWriter,MIJsonWriter
public abstract class AbstractMIJsonWriter<I extends Interaction,B extends BinaryInteraction> extends Object implements InteractionWriter<I>
The jsonWriter which writes the interactions- Since:
05/07/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description AbstractMIJsonWriter()Constructor for AbstractMIJsonWriter.AbstractMIJsonWriter(File file, OntologyTermFetcher fetcher)Constructor for AbstractMIJsonWriter.AbstractMIJsonWriter(File file, OntologyTermFetcher fetcher, ComplexExpansionMethod<I,B> expansionMethod)Constructor for AbstractMIJsonWriter.AbstractMIJsonWriter(OutputStream output, OntologyTermFetcher fetcher)Constructor for AbstractMIJsonWriter.AbstractMIJsonWriter(OutputStream output, OntologyTermFetcher fetcher, ComplexExpansionMethod<I,B> expansionMethod)Constructor for AbstractMIJsonWriter.AbstractMIJsonWriter(Writer writer, OntologyTermFetcher fetcher)Constructor for AbstractMIJsonWriter.AbstractMIJsonWriter(Writer writer, OntologyTermFetcher fetcher, ComplexExpansionMethod<I,B> expansionMethod)Constructor for AbstractMIJsonWriter.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()close.voidend()end.voidflush()flush.protected AbstractMIJsonBinaryWriter<B>getBinaryWriter()Getter for the fieldbinaryWriter.protected abstract voidinitialiseBinaryWriter(File file, OntologyTermFetcher fetcher)initialiseBinaryWriter.protected abstract voidinitialiseBinaryWriter(OutputStream output, OntologyTermFetcher fetcher)initialiseBinaryWriter.protected abstract voidinitialiseBinaryWriter(Writer writer, OntologyTermFetcher fetcher)initialiseBinaryWriter.voidinitialiseContext(Map<String,Object> options)Initialise the context of the InteractionWriter given a map of optionsprotected abstract voidinitialiseDefaultBinaryWriter()initialiseDefaultBinaryWriter.protected abstract voidinitialiseDefaultExpansionMethod()initialiseDefaultExpansionMethod.voidreset()reset.protected voidsetBinaryWriter(AbstractMIJsonBinaryWriter<B> binaryWriter)Setter for the fieldbinaryWriter.protected voidsetExpansionMethod(ComplexExpansionMethod<I,B> expansionMethod)Setter for the fieldexpansionMethod.voidstart()start.voidwrite(I interaction)write.voidwrite(Collection<? extends I> interactions)write.voidwrite(Iterator<? extends I> interactions)Writes Interaction objects using iterator
-
-
-
Constructor Detail
-
AbstractMIJsonWriter
public AbstractMIJsonWriter()
Constructor for AbstractMIJsonWriter.
-
AbstractMIJsonWriter
public AbstractMIJsonWriter(File file, OntologyTermFetcher fetcher) throws IOException
Constructor for AbstractMIJsonWriter.
- Parameters:
file- aFileobject.fetcher- aOntologyTermFetcherobject.- Throws:
IOException- if any.
-
AbstractMIJsonWriter
public AbstractMIJsonWriter(OutputStream output, OntologyTermFetcher fetcher)
Constructor for AbstractMIJsonWriter.
- Parameters:
output- aOutputStreamobject.fetcher- aOntologyTermFetcherobject.
-
AbstractMIJsonWriter
public AbstractMIJsonWriter(Writer writer, OntologyTermFetcher fetcher)
Constructor for AbstractMIJsonWriter.
- Parameters:
writer- aWriterobject.fetcher- aOntologyTermFetcherobject.
-
AbstractMIJsonWriter
public AbstractMIJsonWriter(File file, OntologyTermFetcher fetcher, ComplexExpansionMethod<I,B> expansionMethod) throws IOException
Constructor for AbstractMIJsonWriter.
- Parameters:
file- aFileobject.fetcher- aOntologyTermFetcherobject.expansionMethod- aComplexExpansionMethodobject.- Throws:
IOException- if any.
-
AbstractMIJsonWriter
public AbstractMIJsonWriter(OutputStream output, OntologyTermFetcher fetcher, ComplexExpansionMethod<I,B> expansionMethod)
Constructor for AbstractMIJsonWriter.
- Parameters:
output- aOutputStreamobject.fetcher- aOntologyTermFetcherobject.expansionMethod- aComplexExpansionMethodobject.
-
AbstractMIJsonWriter
public AbstractMIJsonWriter(Writer writer, OntologyTermFetcher fetcher, ComplexExpansionMethod<I,B> expansionMethod)
Constructor for AbstractMIJsonWriter.
- Parameters:
writer- aWriterobject.fetcher- aOntologyTermFetcherobject.expansionMethod- aComplexExpansionMethodobject.
-
-
Method Detail
-
initialiseContext
public void initialiseContext(Map<String,Object> options)
Initialise the context of the InteractionWriter given a map of options- Specified by:
initialiseContextin interfaceInteractionWriter<I extends Interaction>- Parameters:
options- : the options given by the user
-
start
public void start() throws MIIOExceptionstart.
- Specified by:
startin interfaceInteractionWriter<I extends Interaction>- Throws:
MIIOException- if any.
-
end
public void end() throws MIIOExceptionend.
- Specified by:
endin interfaceInteractionWriter<I extends Interaction>- Throws:
MIIOException- if any.
-
write
public void write(I interaction) throws MIIOException
write.
- Specified by:
writein interfaceInteractionWriter<I extends Interaction>- Parameters:
interaction- a I object.- Throws:
MIIOException- if any.
-
write
public void write(Collection<? extends I> interactions) throws MIIOException
write.
- Specified by:
writein interfaceInteractionWriter<I extends Interaction>- Parameters:
interactions- aCollectionobject.- Throws:
MIIOException- if any.
-
write
public void write(Iterator<? extends I> interactions) throws MIIOException
Writes Interaction objects using iterator- Specified by:
writein interfaceInteractionWriter<I extends Interaction>- Parameters:
interactions- : the iterator of interactions to write- Throws:
MIIOException- : if cannot write
-
flush
public void flush() throws MIIOExceptionflush.
- Specified by:
flushin interfaceInteractionWriter<I extends Interaction>- Throws:
MIIOException- if any.
-
close
public void close() throws MIIOExceptionclose.
- Specified by:
closein interfaceInteractionWriter<I extends Interaction>- Throws:
MIIOException- if any.
-
reset
public void reset() throws MIIOExceptionreset.
- Specified by:
resetin interfaceInteractionWriter<I extends Interaction>- Throws:
MIIOException- if any.
-
getBinaryWriter
protected AbstractMIJsonBinaryWriter<B> getBinaryWriter()
Getter for the field
binaryWriter.- Returns:
- a
AbstractMIJsonBinaryWriterobject.
-
setBinaryWriter
protected void setBinaryWriter(AbstractMIJsonBinaryWriter<B> binaryWriter)
Setter for the field
binaryWriter.- Parameters:
binaryWriter- aAbstractMIJsonBinaryWriterobject.
-
setExpansionMethod
protected void setExpansionMethod(ComplexExpansionMethod<I,B> expansionMethod)
Setter for the field
expansionMethod.- Parameters:
expansionMethod- aComplexExpansionMethodobject.
-
initialiseDefaultExpansionMethod
protected abstract void initialiseDefaultExpansionMethod()
initialiseDefaultExpansionMethod.
-
initialiseBinaryWriter
protected abstract void initialiseBinaryWriter(File file, OntologyTermFetcher fetcher) throws IOException
initialiseBinaryWriter.
- Parameters:
file- aFileobject.fetcher- aOntologyTermFetcherobject.- Throws:
IOException- if any.
-
initialiseBinaryWriter
protected abstract void initialiseBinaryWriter(OutputStream output, OntologyTermFetcher fetcher)
initialiseBinaryWriter.
- Parameters:
output- aOutputStreamobject.fetcher- aOntologyTermFetcherobject.
-
initialiseBinaryWriter
protected abstract void initialiseBinaryWriter(Writer writer, OntologyTermFetcher fetcher)
initialiseBinaryWriter.
- Parameters:
writer- aWriterobject.fetcher- aOntologyTermFetcherobject.
-
initialiseDefaultBinaryWriter
protected abstract void initialiseDefaultBinaryWriter()
initialiseDefaultBinaryWriter.
-
-