com.io7m.jpra.model.contexts

## Class GlobalContexts

- java.lang.Object
- - com.io7m.jpra.model.contexts.GlobalContexts

- All Implemented Interfaces:
    GlobalContextType

      public final class GlobalContexts
      extends Object
      implements GlobalContextType

  Access to global contexts.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Queue<JPRAException>` | `getErrorQueue()`
    `IdentifierType` | `getFreshIdentifier()`
    `Map<PackageNameQualified,PackageContextType>` | `getPackages()`
    `TypeUserDefinedType` | `getType(IdentifierType id)` Return a type previously added with `GlobalContextType.putType(TypeUserDefinedType)`.
    `PackageContextType` | `loadPackage(PackageNameQualified p)` Load and return a package into the context.
    `static GlobalContextType` | `newContext(JPRAPackageLoaderType in_loader)`
    `void` | `putType(TypeUserDefinedType t)` Introduce a new type into the global context

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### newContext

          public static GlobalContextType newContext(JPRAPackageLoaderType in_loader)

      Parameters:
        `in_loader` - A package loader
      Returns:
        A new global context

    - #### getErrorQueue

          public Queue<JPRAException> getErrorQueue()

      Specified by:
        `getErrorQueue` in interface `GlobalContextType`
      Returns:
        The global error queue

    - #### getFreshIdentifier

          public IdentifierType getFreshIdentifier()

      Specified by:
        `getFreshIdentifier` in interface `GlobalContextType`
      Returns:
        A fresh identifier that has not been returned before

    - #### getPackages

          public Map<PackageNameQualified,PackageContextType> getPackages()

      Specified by:
        `getPackages` in interface `GlobalContextType`
      Returns:
        A read-only view of the set of packages in the context

    - #### loadPackage

          public PackageContextType loadPackage(PackageNameQualified p)
                                         throws JPRAModelLoadingException

      Description copied from interface: `GlobalContextType`
      Load and return a package into the context.
      Specified by:
        `loadPackage` in interface `GlobalContextType`
      Parameters:
        `p` - The name of the package
      Returns:
        The loaded package
      Throws:
        `JPRAModelLoadingException` - Iff the package cannot be loaded

    - #### putType

          public void putType(TypeUserDefinedType t)

      Description copied from interface: `GlobalContextType`
      Introduce a new type into the global context
      Specified by:
        `putType` in interface `GlobalContextType`
      Parameters:
        `t` - The type

    - #### getType

          public TypeUserDefinedType getType(IdentifierType id)

      Description copied from interface: `GlobalContextType`
      Return a type previously added with `GlobalContextType.putType(TypeUserDefinedType)`.
      Specified by:
        `getType` in interface `GlobalContextType`
      Parameters:
        `id` - The identifier
      Returns:
        The type associated with the given identifier

Copyright © 2016 <code@io7m.com> http://io7m.com