Java Technology
Interface Coding Template

Overview

This template is intended to assist in the creation of a Java interface. It is based on the assumption that deletion of extraneous information is easier than remembering or looking up a seldom-used construct. Thus, the template lists all syntactical constructs valid for an interface declaration, including valid javadoc comment tags. Descriptions of most constructs in the template may be found in the Interface Declaration Syntax Summary.

The template is used by

  1. Copying it into a file with an appropriate name (i.e., the file name should be same as the name of the interface, only with ".java" appended);
  2. Using the search-and-replace feature of your editor to replace the word "InterfaceName" with the name of the interface, and the string "package_name" with the name of the package for the interface;
  3. Deleting template code that is not needed and/or self-contradictory;
  4. Adding code as necessary to complete the interface.

The template layout is designed for maximum readability and maintainabilty, and reflects L's Java coding style. It is expected that individuals will change the layout of the template to suit individual or project coding styles.

The template may be downloaded by using the 'Save' or 'Sava As' option of your browser, and by stripping off the leading and trailing HTML syntax. This template may be freely redistributed and used.

Interface Coding Template

/*                      package_name.InterfaceName
 */
package package_name;

import  external_package.external_class_name;
import  external_package.*;

/* 
 * Application:
 *     
 * Copyright (C) date copyright_holder
 */   
/**
 * Interface Purpose: 
 *  <p>
 * Notes: 
 *  <p>
 * @version version_number
 * @author  author_name
 */
public interface InterfaceName extends superinterface, superinterface {

/*
 ******************************************************************************
 *                      Field Variable Declarations
 ******************************************************************************
 *
 *                      Constant Fields
 */
/**
 *                      description
 *                      @serial field_name field_type
 *                      @since  version
 *                      @see    #methodName
 *                      @see    external_classname#methodName
 */
  public static final type FIELD_NAME = constant;
  public static final type[] FIELD_NAME = {constant, constant};
/*
 ******************************************************************************
 *                      Abstract Methods
 ******************************************************************************
 *
 *                      InterfaceName.methodName
 */
/**
 * Purpose:
 *  <p>
 * Notes:
 *  <p>
 * @param     arg_name description
 * @return    description
 * @exception exception_name description
 * @see       #methodName
 * @see       external_classname#methodName
 */
  public abstract type|void methodName (type arg_name, type arg_name)
  throws exception_name, exception_name ;
/*
 ******************************************************************************
 *
 *                      InterfaceName.methodName
 */
/**
 * Purpose:
 *  <p>
 * Notes:
 *  <p>
 * @param     arg_name description
 * @return    description
 * @exception exception_name description
 * @see       #methodName
 * @see       external_classname#methodName
 */
  public abstract type|void methodName (type arg_name, type arg_name)
  throws exception_name, exception_name ;

}                       // End of package_name.InterfaceName


[home]
[OO] [Java] [memorial ships]
[humor] [income tax repeal]


Copyright (C) 1998 LDJ Trust