/**
 * An interface for a contrived table class.  These classes are intended to
 * represent ordered collections of non-negative integers.
 *
 * @author <a href="mailto:terran@cs.unm.edu">Terran Lane</a>
 * @version 1.0
 */

import java.util.Iterator;

public interface TDRLTable {
  /**
   * Returns the size of the underlying table.
   */
  public int size();

  /**
   * Inserts an item into the table, replacing whatever's currently there.
   *
   * @param item Item to insert.  Must be non-negative.
   * @param idx Place to put the item.  Must be <code>0<=idx<size()</code>.
   * @throws IllegalArgumentException If either <code>item</code> or
   * <code>idx</code> is out of bounds.
   */
  public void put(int item, int idx);

  /**
   * Returns an iterator over the current table.  This iterator returns data
   * in the <em>opposite</em> of table index order.
   */
  public Iterator getIterator();
}
