|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
T - the type of object represented in this data resourcepublic interface IDataSource<T>
An object that mediate between an IDataSourceDictionary and the data
that is contained in the dictionary data resources. Data resources are
assigned a name (e.g., verb.data, for the data resource pertaining to
verbs) and a content type. Data resources are assumed to be indexed by keys
that can be passed into the getLine(String) method to find a
particular piece of data in the resource. The String return can
be parsed by the parser associated with the content type to produce a data
object (e.g., an ISynset or IIndexWord object).
The iterator produced by this class should not support the
Iterator.remove() operation; if that method is called, the iterator
will throw an UnsupportedOperationException.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface edu.mit.jwi.data.IHasLifecycle |
|---|
IHasLifecycle.LifecycleState, IHasLifecycle.ObjectClosedException, IHasLifecycle.ObjectOpenException |
| Method Summary | |
|---|---|
IContentType<T> |
getContentType()
Returns the assigned content type of the resource that backs this object. |
java.lang.String |
getLine(java.lang.String key)
Returns the line in the resource contains the data indexed by the specified key. |
java.lang.String |
getName()
Returns a string representation of the name of this resource. |
java.util.Iterator<java.lang.String> |
iterator(java.lang.String key)
Returns an iterator that will iterator over lines in the data resource, starting at the line specified by the given key. |
| Methods inherited from interface edu.mit.jwi.item.IHasVersion |
|---|
getVersion |
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Methods inherited from interface edu.mit.jwi.data.IHasLifecycle |
|---|
isOpen, open |
| Methods inherited from interface edu.mit.jwi.data.IClosable |
|---|
close |
| Method Detail |
|---|
java.lang.String getName()
null, empty, or
all whitespaceIContentType<T> getContentType()
null.java.lang.String getLine(java.lang.String key)
null
key - the key which indexes the desired data
java.lang.NullPointerException - if the specified key is nulljava.util.Iterator<java.lang.String> iterator(java.lang.String key)
null, this is the same as calling the plain
Iterable.iterator() method. If no line starts with the pattern, the
iterator's Iterator.hasNext() will return false. The
iterator does not support the Iterator.remove() operation; if
that method is called, the iterator will throw an
UnsupportedOperationException.
key - the key at which the iterator should begin
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||