
/**
 * This is a generic example of a Single Abstract Method interface. It is an
 * interface with exactly one abstract (that is, undefined) method.
 * <p>
 * The class {@link ImplementsSAM} implements this interface.
 * <p>
 * The program {@link UseSAM} has a method that expects to be given a
 * SAM-implementing object, and it calls that method three times: once with an
 * object of the ImplementsSAM class, and twice with lambda expressions. The
 * lambda expressions save the programmer the trouble of creating an
 * implementing class. Instead the computer just generates an object that
 * implements the interface based on the two parts of the lambda expression.
 * <pre>
 *    a -> command
 * &#8658;
 *    public void singleAbstractMethod(int a) {
 *        command;
 *    }</pre>
 * <p>
 * If the single abstract method were value returning, the translation would add
 * a return command. So if it returned double, the translation would be
 * <pre>
 *    a -> expression
 * &#8658;
 *    public double singleAbstractMethod(int a) {
 *        return expression;
 *    }</pre>
 * <p>
 * Finally, it is possible to add multiple commands by using braces in the
 * lambda expression:
 * <pre>
 *    a -> {command1; command2; command3;}
 * &#8658;
 *    public void singleAbstractMethod(int a) {
 *        command1;
 *        command2;
 *        command3;
 *    }</pre> 
 * <p>
 * In this case, a value returning method would need to include the
 * return command explicitly:
 * <pre>
 *    a -> {command; return expression;}
 * &#8658;
 *    public double singleAbstractMethod(int a) {
 *        command;
 *        return expression;
 *    }</pre>
 *
 *
 * @author Mark Young (A00000000)
 */
public interface SAM {

    public void singleAbstractMethod(int num);

}
