<commit_before>/**
 * Copyright (C) 2009-2013 Akiban Technologies, Inc.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.akiban.qp.persistitadapter.indexcursor;

import com.akiban.qp.row.Row;
import com.persistit.Exchange;
import com.persistit.Key;
import com.persistit.Key.Direction;
import com.persistit.exception.PersistitException;

public interface IterationHelper
{
    Row row();
    void openIteration();
    void closeIteration();
    Key key();

    /** Clear internal state. */
    void clear();

    /**
     * Advance internal state by finding the next key.
     * @param deep  <code>true</code> if the next physical key is desired, <code>false</code> if logical is.
     * @return <code>true</code> if there was a key/value to traverse to.
     */
    boolean next(boolean deep);

    /**
     * Advance internal state by finding the previous key.
     * @param deep  <code>true</code> if the next physical key is desired, <code>false</code> if logical is.
     * @return <code>true</code> if there was a key/value to traverse to.
     */
    boolean prev(boolean deep);

    boolean traverse(Direction dir, boolean deep);
}
<commit_msg>Javadoc interface<commit_after>/**
 * Copyright (C) 2009-2013 Akiban Technologies, Inc.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.akiban.qp.persistitadapter.indexcursor;

import com.akiban.qp.row.Row;
import com.persistit.Exchange;
import com.persistit.Key;
import com.persistit.Key.Direction;
import com.persistit.exception.PersistitException;

public interface IterationHelper
{
    /** Get the (stateful) key associated with this helper. */
    Key key();

    /** Clear internal state, including the {@link #key()}. */
    void clear();

    /** Begin a new iteration. */
    void openIteration();

    /** Close the current iteration. */
    void closeIteration();

    /**
     * Get the row for that last advancement.
     * <p/>
     * <i>
     *     Note: {@link #next(boolean)}, {@link #prev(boolean)}, or {@link #traverse(Direction, boolean)} must
     *     be called prior to this method.
     * </i>
     */
    Row row();

    /**
     * Advance internal state by finding the next key.
     * @param deep  <code>true</code> if the next physical key is desired, <code>false</code> if logical is.
     * @return <code>true</code> if there was a key/value to traverse to.
     */
    boolean next(boolean deep);

    /**
     * Advance internal state by finding the previous key.
     * @param deep  <code>true</code> if the next physical key is desired, <code>false</code> if logical is.
     * @return <code>true</code> if there was a key/value to traverse to.
     */
    boolean prev(boolean deep);

    /**
     * Advance internal state.
     * @param dir The direction to advance in.
     * @param deep <code>true</code> if the next physical key is desired, <code>false</code> if logical is.
     * @return <code>true</code> if there was a key/value to traverse to.
     */
    boolean traverse(Direction dir, boolean deep);
}

{'fraction_non_alphanumeric': 0.10212666510867024, 'fraction_numerical': 0.0042065903248422526, 'mean_word_length': 3.1553398058252426, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 38, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6963764', 'n_tokens_mistral': 1229, 'n_tokens_neox': 1175, 'n_words': 505}