public class TreebankListDelegate extends java.lang.Object implements SentenceDataList, de.ims.icarus.util.NamedObject, de.ims.icarus.io.Loadable
Constructor and Description |
---|
TreebankListDelegate(Treebank treebank) |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(javax.swing.event.ChangeListener listener) |
void |
free() |
SentenceData |
get(int index) |
SentenceData |
get(int index,
DataType type)
Synchronously fetches the
SentenceData object
for the specified index. |
SentenceData |
get(int index,
DataType type,
AvailabilityObserver observer)
Asynchronously fetches the
SentenceData object
for the specified index. |
de.ims.icarus.util.data.ContentType |
getContentType() |
java.lang.String |
getName() |
Treebank |
getTreebank() |
boolean |
hasTreebank() |
boolean |
isLoaded() |
boolean |
isLoading() |
void |
load() |
void |
removeChangeListener(javax.swing.event.ChangeListener listener) |
int |
size() |
boolean |
supportsType(DataType type) |
java.lang.String |
toString() |
public TreebankListDelegate(Treebank treebank)
public Treebank getTreebank()
public boolean hasTreebank()
public int size()
size
in interface de.ims.icarus.util.data.DataList<SentenceData>
DataList.size()
public SentenceData get(int index)
get
in interface de.ims.icarus.util.data.DataList<SentenceData>
DataList.get(int)
public de.ims.icarus.util.data.ContentType getContentType()
getContentType
in interface de.ims.icarus.util.data.DataContainer
getContentType
in interface de.ims.icarus.util.data.DataList<SentenceData>
DataList.getContentType()
public void addChangeListener(javax.swing.event.ChangeListener listener)
addChangeListener
in interface de.ims.icarus.util.data.DataList<SentenceData>
DataList.addChangeListener(javax.swing.event.ChangeListener)
public void removeChangeListener(javax.swing.event.ChangeListener listener)
removeChangeListener
in interface de.ims.icarus.util.data.DataList<SentenceData>
DataList.removeChangeListener(javax.swing.event.ChangeListener)
public boolean supportsType(DataType type)
supportsType
in interface SentenceDataList
SentenceDataList.supportsType(de.ims.icarus.language.DataType)
public SentenceData get(int index, DataType type)
SentenceDataList
SentenceData
object
for the specified index. If this list
supports
asynchronous loading of elements then this method may
return null
if the desired index
is not
available.get
in interface SentenceDataList
index
- the index of interestSentenceData
object at position index
within this list
SentenceDataList.get(int, de.ims.icarus.language.DataType)
public SentenceData get(int index, DataType type, AvailabilityObserver observer)
SentenceDataList
SentenceData
object
for the specified index.
This method might return null
and use the optional
AvailabilityObserver
to notify about a successful loading
of the desired data later. Implementations should only
store a weak reference to the provided observer
since
the calling code might decide to release the AvailabilityObserver
object and its associated resources while the loading is
still in progress. Therefore exclusive ownership of this object
should be left to the original code that created it.
get
in interface SentenceDataList
index
- the index of interesttype
- the type to fetch an entry forobserver
- the AvailabilityObserver
to be notified
when the asynchronous loading of the desired SentenceData
is finishedSentenceDataList.get(int, de.ims.icarus.language.DataType, de.ims.icarus.language.AvailabilityObserver)
public java.lang.String getName()
getName
in interface de.ims.icarus.util.NamedObject
NamedObject.getName()
public boolean isLoaded()
isLoaded
in interface de.ims.icarus.io.Loadable
Loadable.isLoaded()
public boolean isLoading()
isLoading
in interface de.ims.icarus.io.Loadable
Loadable.isLoading()
public void load() throws java.lang.Exception
load
in interface de.ims.icarus.io.Loadable
java.lang.Exception
Loadable.load()
public void free()
free
in interface de.ims.icarus.io.Loadable
Loadable.free()
public java.lang.String toString()
toString
in class java.lang.Object