NamedType (API documentation of hlt.language packages)
Date: 2013-01-30

hlt.language.design.types

## Class NamedType

- java.lang.Object
- - hlt.language.design.types.Type
  - - hlt.language.design.types.StaticType
    - - hlt.language.design.types.NamedType

- All Implemented Interfaces:
    Valuable
  Direct Known Subclasses:
    TypeConstant, TypeTerm

      public abstract class NamedType
      extends StaticType

  Version:
    Last modified on Sun Oct 21 00:02:08 2012 by hak
  Author:
    Hassan Aït-Kaci
  Copyright:
    © by the author

- - ### Field Summary

    - ### Fields inherited from class hlt.language.design.types.Type

      `ARRAY, BAG, BOOLEAN, BOXABLE, CHAR, CLASS, COLLECTION, CONSTANT, DEFINED, FUNCTION, INT, INT_RANGE, INT_SORT, LIST, NAMED_TUPLE, OBJECT_SORT, PARAMETER, REAL, REAL_RANGE, REAL_SORT, SET, STRING, TUPLE, VOID, VOID_SORT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NamedType()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `eqCode()` Returns a hash code for this type - the reason for using the name `eqCode` (rather than overriding `hashCode`), is that it is important to preserve the implementation of `java.lang.Object.hashCode` for type parameters (to be compatible with `==`).
    `java.lang.String` | `name()`
    `void` | `setName(java.lang.String name)`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class hlt.language.design.types.Type

      `actualType, array, array, baseType, baseTypeRef, BOOLEAN, BOXED_BOOLEAN, BOXED_CHAR, BOXED_INT, BOXED_REAL, boxSort, CHAR, checkOccurrence, copy, copy, curry, equals, findValue, flatten, getParameters, getParameters, getValue, instantiate, INT, is, isBag, isBoolean, isBoxedType, isChar, isCollection, isEqualTo, isEqualTo, isGlobalUnsafe, isInt, isList, isPolymorphic, isPrimitive, isReal, isSet, isString, isVoid, kind, kindString, numberOfTypeComponents, rank, REAL, resetNames, setBoxed, setTypeRefComponent, shadowType, sort, standardize, toFullString, toQuantifiedString, toQuantifiedString, typeComponent, typeRefComponent, unify, unify, unwrapper, value, wrapper`

    - ### Methods inherited from class java.lang.Object

      `getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### NamedType

          public NamedType()

  - ### Method Detail

    - #### name

          public final java.lang.String name()

    - #### setName

          public final void setName(java.lang.String name)

    - #### eqCode

          public int eqCode()

      Description copied from class: `Type`
      Returns a hash code for this type - the reason for using the name `eqCode` (rather than overriding `hashCode`), is that it is important to preserve the implementation of `java.lang.Object.hashCode` for type parameters (to be compatible with `==`). All we require with this new code is that it be compatible with type equality as defined by `isEqualTo` - and it is! Incidentally, the same reason goes for preserving `equals` for type parameters to be compatible with `==` - and it is (see `TypeParameter`).
      Specified by:
        `eqCode` in class `Type`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`