Package org.grouplens.lenskit.data.event

Examples of org.grouplens.lenskit.data.event.MutableRating


        ByteBuffer buf = ByteBuffer.allocate(format.getRatingSize());
        format.renderRating(r, buf);
        buf.flip();

        buf.mark();
        MutableRating r2 = new MutableRating();
        format.readRating(buf, r2);
        assertThat(r2, equalTo(r));

        buf.reset();
        Rating r3 = format.readRating(buf);
View Full Code Here


    private ResultSet resultSet;
    private boolean hasTimestampColumn;
    private MutableRating rating;

    public ResultSetRatingCursor(PreparedStatement stmt) throws SQLException {
        rating = new MutableRating();
        resultSet = stmt.executeQuery();
        try {
            // SUPPRESS CHECKSTYLE MagicNumber
            hasTimestampColumn = resultSet.getMetaData().getColumnCount() >= JDBCRatingDAO.COL_TIMESTAMP;
        } catch (SQLException e) {
View Full Code Here

     */
    public DelimitedTextRatingCursor(@WillCloseWhenClosed @Nonnull BufferedReader s,
                                     @Nullable String name,
                                     @Nonnull String delimiter) {
        fileName = name;
        rating = new MutableRating();
        rowCursor = new DelimitedTextCursor(s, delimiter);
    }
View Full Code Here

                                    "new format is not wider than old");
        logger.info("upgrading {} ratings from {} to {}", index, format, newFormat);

        ByteBuffer oldBuffer = ByteBuffer.allocateDirect(format.getRatingSize());
        ByteBuffer newBuffer = ByteBuffer.allocateDirect(newFormat.getRatingSize());
        MutableRating scratch = new MutableRating();

        long oldPos = BinaryHeader.HEADER_SIZE + index * format.getRatingSize();
        Preconditions.checkState(channel.position() == oldPos,
                                 "channel is at the wrong position");
        long newPos = BinaryHeader.HEADER_SIZE + index * newFormat.getRatingSize();
 
View Full Code Here

TOP

Related Classes of org.grouplens.lenskit.data.event.MutableRating

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.