Commit bbea1653 authored by Matthew Dawson's avatar Matthew Dawson
Browse files

Properly document VariableTypeMarker.

VariableTypeMarker gains javadoc strings.  Also fix the parameter of its
method, to match coding styles.
parent 57c711e4
Loading
Loading
Loading
Loading
+23 −2
Original line number Diff line number Diff line
@@ -29,8 +29,29 @@
package ca.mcscert.jtet.expression;

/**
 * @author Matthew Dawson <matthew@mjdsystems.ca>
 * Provides a mechanism to request an expression resolve to a version of a given type, without fully specifying it.
 * <p>
 * When looking for the appropriate type for an expression, sometimes an applicable type has a large (or infinite)
 * potential forms of a given class.  Type markers allow for a given class to be requested without fully specifying the
 * type.  Due to this, a specific concrete specification of a type is always a marker for itself, since each type is
 * in a given type containing only itself.
 * <p>
 * The type marker concept becomes more useful when considering types like fixed point, which can have any number of
 * digits representing its type.  However, the requesting code often doesn't care how many digits are used, it just
 * wants fixed point to be considered valid.  The fixed point type can provide a special type marker that acts as a
 * marker for all valid fixed point representations.
 *
 * @author Matthew Dawson
 */
interface VariableTypeMarker {
    boolean isMarkerFor(VariableType m_type);
    /**
     * Queries whether the given type is in the class represented by this type marker, and thus marked.
     * <p>
     * Implementations should return true if the given {@link ca.mcscert.jtet.expression.VariableType} is in the class
     * of types represented by this marker, and is thus marked.  Returns false otherwise.  Any valid implementation of
     * {@link ca.mcscert.jtet.expression.VariableType} can be passed in, including from other libraries.
     * @param type The type being checked.
     * @return Whether type is in the class represented by this marker.
     */
    boolean isMarkerFor(VariableType type);
}