package nxm.nettest.inc;

import java.rmi.Remote;
import java.rmi.RemoteException;

import nxm.sys.inc.InternalUseOnly;
import nxm.sys.lib.Table;

/** Sample Remote interface for testing Java's RMI.
    @author Neon Ngo
    @since NeXtMidas 3.1.0
 */
@InternalUseOnly("Since 3.5.2")
public interface SampleInterface extends Remote {
  /** does some computation from x input and then return results as double.
      @param x double precision floating point to do some computation on
      @return computed values are consistent on same server for same values of x
      @throws RemoteException for communications related exceptions
   */
  public double compute (double x)  throws RemoteException;

  /** echo's input string back to client
      @param str string to echo back to client
      @return echo back input as a String
      @throws RemoteException for communications related exceptions
   */
  public String echo (CharSequence str) throws RemoteException;

  /** Convert a NeXtMidas Table to a String with server identifier added in the return string.
      @param tab Table to convert to a string
      @return String format of Table with a _SERVER_= entry added.
      @throws RemoteException for communications related exceptions
   */
  public String toString (Table tab) throws RemoteException;

  /** Try best to convert input string to a Table.
      A "_SERVER_" entry is added to the output Table.
      @param str string to convert to a Table
      @return input string converted to a Table with a _SERVER_= entry added.
      @throws RemoteException for communications related exceptions
   */
  public Table toTable (CharSequence str) throws RemoteException;
}
