|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.mit.jwi.data.WordnetFile.LineIterator
protected abstract class WordnetFile.LineIterator
Used to iterate over lines in a file. It is a look-ahead iterator. This
iterator does not support the remove method; if that method is called, it
throws an UnsupportedOperationException.
| Field Summary | |
|---|---|
protected java.nio.ByteBuffer |
itrBuffer
|
protected java.lang.String |
next
|
protected java.nio.ByteBuffer |
parentBuffer
|
| Constructor Summary | |
|---|---|
WordnetFile.LineIterator(java.nio.ByteBuffer buffer,
java.lang.String key)
Constructs a new line iterator over this buffer, starting at the specified key. |
|
| Method Summary | |
|---|---|
protected void |
advance()
Skips over comment lines to find the next line that would be returned by the iterator in a call to next(). |
protected abstract void |
findFirstLine(java.lang.String key)
Advances the iterator the first line the iterator should return, based on the specified key. |
java.lang.String |
getNextLine()
Returns the line currently stored as the 'next' line, if any. |
boolean |
hasNext()
|
protected boolean |
isComment(java.lang.String line)
Returns true if the specified line is a comment;
false otherwise |
java.lang.String |
next()
|
void |
remove()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final java.nio.ByteBuffer parentBuffer
protected java.nio.ByteBuffer itrBuffer
protected java.lang.String next
| Constructor Detail |
|---|
public WordnetFile.LineIterator(java.nio.ByteBuffer buffer,
java.lang.String key)
buffer - the buffer over which the iterator should iterator; may
not be nullkey - the key of the line to start at; may be null
java.lang.NullPointerException - if the specified buffer is null| Method Detail |
|---|
public java.lang.String getNextLine()
null if noneprotected abstract void findFirstLine(java.lang.String key)
key - the key indexed the first line to be returned by the
iteratorpublic boolean hasNext()
hasNext in interface java.util.Iterator<java.lang.String>protected void advance()
next().
protected boolean isComment(java.lang.String line)
true if the specified line is a comment;
false otherwise
line - the line to be tested
true if the specified line is a comment;
false otherwisepublic java.lang.String next()
next in interface java.util.Iterator<java.lang.String>public final void remove()
remove in interface java.util.Iterator<java.lang.String>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||