public abstract class AbstractMutableSentenceData extends java.lang.Object implements MutableSentenceData
Modifier and Type | Field and Description |
---|---|
protected boolean |
eventsEnabled |
protected java.util.List<SentenceDataListener> |
listeners |
ROOT_INDEX
Constructor and Description |
---|
AbstractMutableSentenceData() |
Modifier and Type | Method and Description |
---|---|
void |
addSentenceDataListener(SentenceDataListener listener)
Adds the given
SentenceDataListener to the list
of registered listeners. |
abstract 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 |
fireDataChanged(SentenceDataEvent event) |
protected boolean |
hasListeners() |
boolean |
isEventsEnabled() |
void |
removeSentenceDataListener(SentenceDataListener listener)
Removes the given
SentenceDataListener from the list
of registered listeners. |
void |
setEventsEnabled(boolean eventsEnabled) |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear, copyFrom, getProperty, setProperty, snapshot
getFeatures, getFlags, getForm, getIndex, getLemma, getPos, getProperty, getSourceGrammar, isEmpty, isFlagSet, length
protected transient java.util.List<SentenceDataListener> listeners
protected boolean eventsEnabled
public void addSentenceDataListener(SentenceDataListener listener)
MutableSentenceData
SentenceDataListener
to the list
of registered listeners. Implementations should make sure
that no listener exists more than once in the internal list.addSentenceDataListener
in interface MutableSentenceData
listener
- the SentenceDataListener
to be addedpublic void removeSentenceDataListener(SentenceDataListener listener)
MutableSentenceData
SentenceDataListener
from the list
of registered listeners. If the listener
is not present
no special actions should be takenremoveSentenceDataListener
in interface MutableSentenceData
listener
- the SentenceDataListener
to be removedpublic boolean isEventsEnabled()
public void setEventsEnabled(boolean eventsEnabled)
eventsEnabled
- the eventsEnabled to setpublic abstract MutableSentenceData clone()
MutableSentenceData
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 MutableSentenceData
clone
in interface SentenceData
clone
in class java.lang.Object
MutableSentenceData
object that is a
copy of the current state of this objectSentenceData.clone()
protected boolean hasListeners()
public void fireDataChanged(SentenceDataEvent event)