public interface SentenceDataWriter extends de.ims.icarus.io.Writer<SentenceData>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
INCLUDE_GOLD_OPTION |
static java.lang.String |
INCLUDE_SYSTEM_OPTION |
static java.lang.String |
INCLUDE_USER_OPTION |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes all underlying I/O-objects.
|
de.ims.icarus.util.data.ContentType |
getDataType() |
void |
init(de.ims.icarus.util.location.Location location,
de.ims.icarus.util.Options options)
Sets the
Location to save data to and initializes
internal state so that calls to write(SentenceData)
will actually start to save SentenceData objects. |
void |
write(SentenceData data) |
static final java.lang.String INCLUDE_SYSTEM_OPTION
static final java.lang.String INCLUDE_GOLD_OPTION
static final java.lang.String INCLUDE_USER_OPTION
void init(de.ims.icarus.util.location.Location location, de.ims.icarus.util.Options options) throws java.io.IOException, de.ims.icarus.util.location.UnsupportedLocationException
Location
to save data to and initializes
internal state so that calls to write(SentenceData)
will actually start to save SentenceData
objects.
The options
parameter is meant to be a hint for
certain implementations on how they should format output
data or whether to write additional meta-data.init
in interface de.ims.icarus.io.Writer<SentenceData>
location
- the Location
to save data tooptions
- a collection of additional info for the writerjava.io.IOException
- forwarding of encountered IOException
sde.ims.icarus.util.location.UnsupportedLocationException
- if the provided Location
is not supported or not validvoid write(SentenceData data) throws java.io.IOException, UnsupportedSentenceDataException
write
in interface de.ims.icarus.io.Writer<SentenceData>
data
- the next SentenceData
object to be writtenjava.io.IOException
- simple forwarding of encountered IOException
sUnsupportedSentenceDataException
- if the given SentenceData
is of a type this writer is unable to handle.void close() throws java.io.IOException
write(SentenceData)
should throw
IOException
. Note that this method might be called
before a 'logical set' of data has been written or even while
a write operation is currently in progress. It is up to the
implementation at hand to decide whether data written so far
should be discarded, meaning the location
being deleted,
or if the output is allowed to stay in a state that could be
described as 'unfinished'. For example a writer that uses
xml
to format SentenceData
objects will typically
discard all data before risking invalid xml
-code.close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable
close
in interface de.ims.icarus.io.Writer<SentenceData>
java.io.IOException
de.ims.icarus.util.data.ContentType getDataType()