// FILE. . . . . /home/hak/hlt/src/hlt/osf/base/DisjunctiveSort.java
// EDIT BY . . . Hassan Ait-Kaci
// ON MACHINE. . Hak-Laptop
// STARTED ON. . Mon Sep 02 09:13:38 2013

/**
 * @version     Last modified on Mon May 18 10:22:27 2015 by hak
 * @author      <a href="mailto:hak@acm.org">Hassan A&iuml;t-Kaci</a>
 * @copyright   &copy; <a href="http://www.hassan-ait-kaci.net/">by the author</a>
 */

package hlt.osf.base;

import hlt.osf.exec.Context;

import hlt.language.util.ArrayList;

/**
 * This is the class of disjunctive sorts. It consists of a list of
 * Strings denoting the sorts of its components.
 */
public class DisjunctiveSort extends SortExpression
  {
    public DisjunctiveSort (ArrayList names)
    {
      _names = names;
    }

    public DisjunctiveSort (ArrayList names, Context context)
    {
      _names = names;
      _context = context;
    }

    private ArrayList _names;

    public ArrayList names ()
    {
      return _names;
    }

    public byte type ()
    {
      return _context.DIS();
    }

    public String displayForm ()
    {
      String form = _context.displayManager().displayFormManager().displaySortsForm(_names);
      return isParenthesized() ? "("+form+")" : form;
    }    
  }
