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

hlt.language.design.types

## Class CollectionTypeConstant

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

- All Implemented Interfaces:
    Collection, Valuable

      public class CollectionTypeConstant
      extends TypeConstant
      implements Collection

  This is the class of constant types that are also collection types.

- - ### 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
    `CollectionTypeConstant(java.lang.String name, Type type)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Type` | `baseType()` Returns the base type's value; that is, the current type binding of the collection's elements.
    `Type` | `baseTypeRef()` Returns the undereferenced base type.
    `byte` | `kind()` This returns the value identifying what kind of type this is.
    `int` | `numberOfTypeComponents()` Returns the number of type components making up this type.
    `void` | `setTypeRefComponent(int n, Type type)` Sets the `n`-th undereferenced type component of this type to the specified type; throws a `NoSuchTypeComponentException` otherwise.
    `Type` | `typeRefComponent(int n)` Returns the `n`-th undereferenced type component in this type, if any; throws a `NoSuchTypeComponentException` otherwise.
    `boolean` | `unify(Type type)` This unifies this type with the specified type with no possibility of undoing any effects.
    `void` | `unify(Type type, TypeChecker typeChecker)` This unifies this type with the specified type in the context of the specified `TypeChecker`.

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

      `isBoxedType, isEqualTo, isEqualTo, setShadowType, shadowType, sort, toString`

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

      `eqCode, name, setName`

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

      `actualType, array, array, 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, isChar, isCollection, isGlobalUnsafe, isInt, isList, isPolymorphic, isPrimitive, isReal, isSet, isString, isVoid, kindString, rank, REAL, resetNames, setBoxed, standardize, toFullString, toQuantifiedString, toQuantifiedString, typeComponent, unwrapper, value, wrapper`

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

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

- - ### Constructor Detail

    - #### CollectionTypeConstant

          public CollectionTypeConstant(java.lang.String name,
                                Type type)

  - ### Method Detail

    - #### numberOfTypeComponents

          public final int numberOfTypeComponents()

      Description copied from class: `Type`
      Returns the number of type components making up this type.
      Overrides:
        `numberOfTypeComponents` in class `TypeConstant`

    - #### typeRefComponent

          public final Type typeRefComponent(int n)
                                      throws NoSuchTypeComponentException

      Description copied from class: `Type`
      Returns the `n`-th undereferenced type component in this type, if any; throws a `NoSuchTypeComponentException` otherwise.
      Overrides:
        `typeRefComponent` in class `TypeConstant`
      Throws:
        `NoSuchTypeComponentException`

    - #### setTypeRefComponent

          public final void setTypeRefComponent(int n,
                                 Type type)
                                         throws NoSuchTypeComponentException

      Description copied from class: `Type`
      Sets the `n`-th undereferenced type component of this type to the specified type; throws a `NoSuchTypeComponentException` otherwise.
      Overrides:
        `setTypeRefComponent` in class `TypeConstant`
      Throws:
        `NoSuchTypeComponentException`

    - #### kind

          public final byte kind()

      Description copied from class: `Type`
      This returns the value identifying what kind of type this is.
      Overrides:
        `kind` in class `TypeConstant`

    - #### baseTypeRef

          public Type baseTypeRef()

      Returns the undereferenced base type.
      Specified by:
        `baseTypeRef` in interface `Collection`
      Overrides:
        `baseTypeRef` in class `Type`

    - #### baseType

          public Type baseType()

      Returns the base type's value; that is, the current type binding of the collection's elements.
      Specified by:
        `baseType` in interface `Collection`
      Overrides:
        `baseType` in class `Type`

    - #### unify

          public final void unify(Type type,
                   TypeChecker typeChecker)
                           throws FailedUnificationException

      Description copied from class: `Type`
      This unifies this type with the specified type in the context of the specified `TypeChecker`.
      Overrides:
        `unify` in class `TypeConstant`
      Throws:
        `FailedUnificationException`

    - #### unify

          public final boolean unify(Type type)

      Description copied from class: `Type`
      This unifies this type with the specified type with no possibility of undoing any effects. This method is meant to be used on types that are fresh copies independent of any type-checker because it will side-effect the structures it traverses. It returns `true` iff unification succeeds. NB: This method does not perform the "occurs-check" test.
      Overrides:
        `unify` in class `TypeConstant`