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 void
close()
close.void
end()
end.void
flush()
flush.protected AbstractMIJsonBinaryWriter<B>
getBinaryWriter()
Getter for the fieldbinaryWriter
.protected abstract void
initialiseBinaryWriter(File file, OntologyTermFetcher fetcher)
initialiseBinaryWriter.protected abstract void
initialiseBinaryWriter(OutputStream output, OntologyTermFetcher fetcher)
initialiseBinaryWriter.protected abstract void
initialiseBinaryWriter(Writer writer, OntologyTermFetcher fetcher)
initialiseBinaryWriter.void
initialiseContext(Map<String,Object> options)
Initialise the context of the InteractionWriter given a map of optionsprotected abstract void
initialiseDefaultBinaryWriter()
initialiseDefaultBinaryWriter.protected abstract void
initialiseDefaultExpansionMethod()
initialiseDefaultExpansionMethod.void
reset()
reset.protected void
setBinaryWriter(AbstractMIJsonBinaryWriter<B> binaryWriter)
Setter for the fieldbinaryWriter
.protected void
setExpansionMethod(ComplexExpansionMethod<I,B> expansionMethod)
Setter for the fieldexpansionMethod
.void
start()
start.void
write(I interaction)
write.void
write(Collection<? extends I> interactions)
write.void
write(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
- aFile
object.fetcher
- aOntologyTermFetcher
object.- Throws:
IOException
- if any.
-
AbstractMIJsonWriter
public AbstractMIJsonWriter(OutputStream output, OntologyTermFetcher fetcher)
Constructor for AbstractMIJsonWriter.
- Parameters:
output
- aOutputStream
object.fetcher
- aOntologyTermFetcher
object.
-
AbstractMIJsonWriter
public AbstractMIJsonWriter(Writer writer, OntologyTermFetcher fetcher)
Constructor for AbstractMIJsonWriter.
- Parameters:
writer
- aWriter
object.fetcher
- aOntologyTermFetcher
object.
-
AbstractMIJsonWriter
public AbstractMIJsonWriter(File file, OntologyTermFetcher fetcher, ComplexExpansionMethod<I,B> expansionMethod) throws IOException
Constructor for AbstractMIJsonWriter.
- Parameters:
file
- aFile
object.fetcher
- aOntologyTermFetcher
object.expansionMethod
- aComplexExpansionMethod
object.- Throws:
IOException
- if any.
-
AbstractMIJsonWriter
public AbstractMIJsonWriter(OutputStream output, OntologyTermFetcher fetcher, ComplexExpansionMethod<I,B> expansionMethod)
Constructor for AbstractMIJsonWriter.
- Parameters:
output
- aOutputStream
object.fetcher
- aOntologyTermFetcher
object.expansionMethod
- aComplexExpansionMethod
object.
-
AbstractMIJsonWriter
public AbstractMIJsonWriter(Writer writer, OntologyTermFetcher fetcher, ComplexExpansionMethod<I,B> expansionMethod)
Constructor for AbstractMIJsonWriter.
- Parameters:
writer
- aWriter
object.fetcher
- aOntologyTermFetcher
object.expansionMethod
- aComplexExpansionMethod
object.
-
-
Method Detail
-
initialiseContext
public void initialiseContext(Map<String,Object> options)
Initialise the context of the InteractionWriter given a map of options- Specified by:
initialiseContext
in interfaceInteractionWriter<I extends Interaction>
- Parameters:
options
- : the options given by the user
-
start
public void start() throws MIIOException
start.
- Specified by:
start
in interfaceInteractionWriter<I extends Interaction>
- Throws:
MIIOException
- if any.
-
end
public void end() throws MIIOException
end.
- Specified by:
end
in interfaceInteractionWriter<I extends Interaction>
- Throws:
MIIOException
- if any.
-
write
public void write(I interaction) throws MIIOException
write.
- Specified by:
write
in 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:
write
in interfaceInteractionWriter<I extends Interaction>
- Parameters:
interactions
- aCollection
object.- Throws:
MIIOException
- if any.
-
write
public void write(Iterator<? extends I> interactions) throws MIIOException
Writes Interaction objects using iterator- Specified by:
write
in interfaceInteractionWriter<I extends Interaction>
- Parameters:
interactions
- : the iterator of interactions to write- Throws:
MIIOException
- : if cannot write
-
flush
public void flush() throws MIIOException
flush.
- Specified by:
flush
in interfaceInteractionWriter<I extends Interaction>
- Throws:
MIIOException
- if any.
-
close
public void close() throws MIIOException
close.
- Specified by:
close
in interfaceInteractionWriter<I extends Interaction>
- Throws:
MIIOException
- if any.
-
reset
public void reset() throws MIIOException
reset.
- Specified by:
reset
in interfaceInteractionWriter<I extends Interaction>
- Throws:
MIIOException
- if any.
-
getBinaryWriter
protected AbstractMIJsonBinaryWriter<B> getBinaryWriter()
Getter for the field
binaryWriter
.- Returns:
- a
AbstractMIJsonBinaryWriter
object.
-
setBinaryWriter
protected void setBinaryWriter(AbstractMIJsonBinaryWriter<B> binaryWriter)
Setter for the field
binaryWriter
.- Parameters:
binaryWriter
- aAbstractMIJsonBinaryWriter
object.
-
setExpansionMethod
protected void setExpansionMethod(ComplexExpansionMethod<I,B> expansionMethod)
Setter for the field
expansionMethod
.- Parameters:
expansionMethod
- aComplexExpansionMethod
object.
-
initialiseDefaultExpansionMethod
protected abstract void initialiseDefaultExpansionMethod()
initialiseDefaultExpansionMethod.
-
initialiseBinaryWriter
protected abstract void initialiseBinaryWriter(File file, OntologyTermFetcher fetcher) throws IOException
initialiseBinaryWriter.
- Parameters:
file
- aFile
object.fetcher
- aOntologyTermFetcher
object.- Throws:
IOException
- if any.
-
initialiseBinaryWriter
protected abstract void initialiseBinaryWriter(OutputStream output, OntologyTermFetcher fetcher)
initialiseBinaryWriter.
- Parameters:
output
- aOutputStream
object.fetcher
- aOntologyTermFetcher
object.
-
initialiseBinaryWriter
protected abstract void initialiseBinaryWriter(Writer writer, OntologyTermFetcher fetcher)
initialiseBinaryWriter.
- Parameters:
writer
- aWriter
object.fetcher
- aOntologyTermFetcher
object.
-
initialiseDefaultBinaryWriter
protected abstract void initialiseDefaultBinaryWriter()
initialiseDefaultBinaryWriter.
-
-