import java.io.IOException;

/**
 * This interface implements a input channel, from where data can be read.
 * @author fpereira
 *
 * @param <E> The type of the data that is read.
 */
public interface InChannel<E> {
  /**
   * Is true if there is more data to be read, and it is false if the last
   * data has been read.
   * @return a boolean value.
   */
  boolean hasData();

  /**
   * Gives back the next data to be read.
   * @return an object that is the next value read.
   * @throws IOException In case we fail to read data.
   */
  E read() throws IOException;
}
