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

hlt.osf.exec

## Class Taxonomy

- java.lang.Object
- - java.util.AbstractCollection<E>
  - - java.util.AbstractList
    - - hlt.language.util.ArrayList
      - - hlt.osf.exec.Taxonomy

- All Implemented Interfaces:
    Contextable, java.lang.Iterable, java.util.Collection, java.util.List

      public class Taxonomy
      extends ArrayList
      implements Contextable

  This is a class extending ArrayList for storing Sort objects.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Taxonomy()` Construct a taxonomy.
    `Taxonomy(Context context)` Construct a taxonomy with the specified Context.
    `Taxonomy(int initialCapacity)` Construct a taxonomy of the specified initial capaciity.
    `Taxonomy(int initialCapacity, Context context)` Construct a taxonomy of the specified initial capaciity and the specified Context.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `BitCode` | `computeAncestors(Sort sort)` Returns the set of ancestors of the specified sort as a BitCode.
    `BitCode` | `computeDescendants(Sort sort)` Returns the set of descendants of the specified sort as a BitCode.
    `int` | `computeHeight(Sort sort)` Returns the height of the specified sort in its taxonomy.
    `Context` | `context()` Returns this taxonomy's sort ordering context.
    `void` | `encodeSorts()` Encodes all the sorts of this taxonomy.
    `void` | `encodeSorts(int first, int last)` Encodes the sorts between index first and index last (both inclusive) of this sort code array, reorders it so that a sort is always below its upper sorts, and check for cycles, committing all defined sorts in the specified range.
    `Sort` | `getSort(int index)` This returns the sort with specified index in this taxonomy.
    `static boolean` | `isLocked()` Returns true iff the current sort taxonomy has been been encoded.
    `BitCode` | `maxLowerBounds(BitCode code)` This returns a bit code representing the set of sorts whose codes are the maximal lower bounds of the specified bit code as explained in the specification.
    `BitCode` | `maxLowerBounds(BitCode code, BitCode mlbs)`
    `BitCode` | `minUpperBounds(BitCode code)` This returns a bit code representing the set of sorts whose codes are the minimal upper bounds of the specified bit code as explained in the specification.
    `BitCode` | `minUpperBounds(BitCode code, BitCode mubs)`
    `void` | `reset(int minIndex)`
    `Taxonomy` | `setContext(Context context)` Set this taxonomy's sort ordering context to the specified one.
    `void` | `showSortCodes()` This displays all the defined sorts in this taxonomy using the specified display manager.
    `void` | `showSortCodes(int first, int last)` This displays the elements of this taxonomy between index first and index last (both inclusive) using the specified display manager.
    `void` | `unlock()` Unlocks this taxonomy.

    - ### Methods inherited from class hlt.language.util.ArrayList

      `add, add, addAll, addAll, addAll, addAll, addElement, capacity, clear, clear, clone, contains, containsAll, containsAll, copyInto, elementAt, ensureCapacity, equals, firstElement, get, hasGaps, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAll, removeAllElements, removeAllFirst, removeAllFirst, removeElement, removeElementAt, removeGaps, removeRange, retainAll, set, setElementAt, setIncrementFactor, setLast, setSize, size, toArray, toString, toStringArray, trimToSize`

    - ### Methods inherited from class java.util.AbstractList

      `addAll, listIterator, listIterator, subList`

    - ### Methods inherited from class java.util.AbstractCollection

      `addAll, containsAll, removeAll, retainAll, toArray`

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

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

    - ### Methods inherited from interface java.util.Collection

      `addAll, containsAll, removeAll, retainAll, toArray`

    - ### Methods inherited from interface java.util.List

      `addAll, containsAll, removeAll, retainAll, toArray`

- - ### Constructor Detail

    - #### Taxonomy

          public Taxonomy()

      Construct a taxonomy.

    - #### Taxonomy

          public Taxonomy(int initialCapacity)

      Construct a taxonomy of the specified initial capaciity.

    - #### Taxonomy

          public Taxonomy(Context context)

      Construct a taxonomy with the specified Context.

    - #### Taxonomy

          public Taxonomy(int initialCapacity,
                  Context context)

      Construct a taxonomy of the specified initial capaciity and the specified Context.

  - ### Method Detail

    - #### context

          public Context context()

      Returns this taxonomy's sort ordering context.
      Specified by:
        `context` in interface `Contextable`

    - #### setContext

          public Taxonomy setContext(Context context)

      Set this taxonomy's sort ordering context to the specified one.
      Specified by:
        `setContext` in interface `Contextable`

    - #### getSort

          public Sort getSort(int index)

      This returns the sort with specified index in this taxonomy.

    - #### isLocked

          public static boolean isLocked()

      Returns true iff the current sort taxonomy has been been encoded.

    - #### unlock

          public void unlock()

      Unlocks this taxonomy.

    - #### encodeSorts

          public void encodeSorts()
                           throws AnomalousSituationException

      Encodes all the sorts of this taxonomy.
      Throws:
        `AnomalousSituationException`

    - #### encodeSorts

          public void encodeSorts(int first,
                         int last)
                           throws AnomalousSituationException,
                                  LockedCodeArrayException,
                                  CyclicSortOrderingException

      Encodes the sorts between index first and index last (both inclusive) of this sort code array, reorders it so that a sort is always below its upper sorts, and check for cycles, committing all defined sorts in the specified range.
      Throws:
        `AnomalousSituationException`
        `LockedCodeArrayException`
        `CyclicSortOrderingException`

    - #### reset

          public void reset(int minIndex)

    - #### maxLowerBounds

          public BitCode maxLowerBounds(BitCode code)
                                 throws LockedCodeArrayException

      This returns a bit code representing the set of sorts whose codes are the maximal lower bounds of the specified bit code as explained in the specification. Note that the returned bit code may be empty (if the code is the bottom sort's code). This assumes that this this taxonomy has been encoded (and therefore reordered).
      Throws:
        `LockedCodeArrayException`

    - #### maxLowerBounds

          public BitCode maxLowerBounds(BitCode code,
                               BitCode mlbs)
                                 throws LockedCodeArrayException,
                                        LockedBitCodeException

      Throws:
        `LockedCodeArrayException`
        `LockedBitCodeException`

    - #### minUpperBounds

          public BitCode minUpperBounds(BitCode code)
                                 throws LockedCodeArrayException

      This returns a bit code representing the set of sorts whose codes are the minimal upper bounds of the specified bit code as explained in the specification. Note that the returned bit code may be empty (if the code is the top sort's code). This assumes that this this taxonomy has been encoded (and therefore reordered).
      Throws:
        `LockedCodeArrayException`

    - #### minUpperBounds

          public BitCode minUpperBounds(BitCode code,
                               BitCode mubs)
                                 throws LockedCodeArrayException,
                                        LockedBitCodeException

      Throws:
        `LockedCodeArrayException`
        `LockedBitCodeException`

    - #### computeHeight

          public int computeHeight(Sort sort)
                            throws LockedCodeArrayException

      Returns the height of the specified sort in its taxonomy. (See the specification.)
      Throws:
        `LockedCodeArrayException`

    - #### computeDescendants

          public BitCode computeDescendants(Sort sort)
                                     throws LockedCodeArrayException

      Returns the set of descendants of the specified sort as a BitCode. (See the specification.)
      Throws:
        `LockedCodeArrayException`

    - #### computeAncestors

          public BitCode computeAncestors(Sort sort)
                                   throws LockedCodeArrayException

      Returns the set of ancestors of the specified sort as a BitCode. (See the specification.)
      Throws:
        `LockedCodeArrayException`

    - #### showSortCodes

          public void showSortCodes()

      This displays all the defined sorts in this taxonomy using the specified display manager.

    - #### showSortCodes

          public void showSortCodes(int first,
                           int last)

      This displays the elements of this taxonomy between index first and index last (both inclusive) using the specified display manager. It always displays @ at the top (with no index) and {} at the bottom (with no index).