public interface MutableSentenceData extends SentenceData
SentenceData
interface that supports
modifications and the ability to notify registered SentenceDataListener
objects about changes to a certain MutableSentenceData
object.ROOT_INDEX
Modifier and Type | Method and Description |
---|---|
void |
addSentenceDataListener(SentenceDataListener listener)
Adds the given
SentenceDataListener to the list
of registered listeners. |
void |
clear()
Erases all data contained within this
MutableSentenceData so
that subsequent calls to SentenceData.isEmpty() return true |
MutableSentenceData |
clone()
Returns a copy of this
MutableSentenceData that
represents the exact same state the original object was in
at the time this method is called. |
void |
copyFrom(SentenceData source)
Copies data from the provided
SentenceData object. |
java.lang.Object |
getProperty(java.lang.String key)
Returns the value of a previously stored mapping
|
void |
removeSentenceDataListener(SentenceDataListener listener)
Removes the given
SentenceDataListener from the list
of registered listeners. |
void |
setProperty(java.lang.String key,
java.lang.Object value)
Stores a mapping from
key to a value of arbitrary type. |
SentenceData |
snapshot()
Returns the current state of this mutable object as an
immutable
SentenceData instance |
getFeatures, getFlags, getForm, getIndex, getLemma, getPos, getProperty, getSourceGrammar, isEmpty, isFlagSet, length
MutableSentenceData clone()
MutableSentenceData
that
represents the exact same state the original object was in
at the time this method is called. Does not copy listeners!
In contrast to the original method SentenceData.clone()
the returned object has to be mutable!clone
in interface SentenceData
MutableSentenceData
object that is a
copy of the current state of this objectSentenceData.clone()
SentenceData snapshot()
SentenceData
instanceMutableSentenceData
objectvoid copyFrom(SentenceData source)
SentenceData
object.
Implementations should throw UnsupportedSentenceDataException
if the operation is not possible due to incompatibility.source
- the SentenceData
object to copy data fromUnsupportedSentenceDataException
- if the source
parameter is of an unknown SentenceData
type or the content
of this object is not compatiblevoid clear()
MutableSentenceData
so
that subsequent calls to SentenceData.isEmpty()
return true
void addSentenceDataListener(SentenceDataListener listener)
SentenceDataListener
to the list
of registered listeners. Implementations should make sure
that no listener exists more than once in the internal list.listener
- the SentenceDataListener
to be addedvoid removeSentenceDataListener(SentenceDataListener listener)
SentenceDataListener
from the list
of registered listeners. If the listener
is not present
no special actions should be takenlistener
- the SentenceDataListener
to be removedvoid setProperty(java.lang.String key, java.lang.Object value)
key
to a value of arbitrary type.
It is up to an implementation how to handle null
values
but the recommended way is to use null
as hint for removing
a certain mapping entirely.java.lang.Object getProperty(java.lang.String key)
getProperty
in interface SentenceData