public class DelimitedTextRatingCursor extends AbstractPollingCursor<Rating>
Compatibility: Public
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
logger |
Constructor and Description |
---|
DelimitedTextRatingCursor(java.io.BufferedReader s,
java.lang.String name,
java.lang.String delimiter)
Construct a rating cursor from a reader.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
No-op implementation of the
Cursor.close() method. |
Rating |
copy(Rating r)
Construct a copy of an object.
|
Rating |
poll()
Return the next element in this Cursor, or null if there are no more
elements.
|
fastNext, hasNext, next
fast, getRowCount, iterator
public DelimitedTextRatingCursor(@WillCloseWhenClosed @Nonnull java.io.BufferedReader s, @Nullable java.lang.String name, @Nonnull java.lang.String delimiter)
s
- The reader to read.name
- The file name (for error messages).delimiter
- The delimiter.public void close()
AbstractCursor
Cursor.close()
method.public Rating poll()
AbstractPollingCursor
AbstractPollingCursor.copy(Object)
copies objects. If this
method returns a fresh object every time, then AbstractPollingCursor.copy(Object)
should be a no-op.poll
in class AbstractPollingCursor<Rating>
public Rating copy(Rating r)
AbstractPollingCursor
AbstractPollingCursor.poll()
method, and override this method to create a new copy of an object for when
AbstractPollingCursor.next()
is called. Subclasses which return fresh objects on each
call to AbstractPollingCursor.poll()
do not need to override this method.copy
in class AbstractPollingCursor<Rating>
r
- The object to copy.obj
.