Class InfiniteConcept

  • All Implemented Interfaces:
    java.lang.Cloneable, InequalityTerm, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
    Direct Known Subclasses:
    FlatTokenInfiniteConcept, MapTypeInfiniteConcept

    public abstract class InfiniteConcept
    extends Concept
    A concept that is not part of a finite ontology. This class represents Concepts that, rather than being drawn from a fixed finite set of the elements in a ConceptGraph, are drawn from a potentially infinite set, such as those used to represent structured datatypes like records, concepts parameterized over values, and other situations where enumerating all possible concepts beforehand is not feasible.

    Since this class aims to be a general superclass of any type of infinite concept, it does not provide any implementations that may be particular to a particular style of infinite concepts, and is abstract. Subclasses are responsible for determining exactly what type of infinite concept they will support.

    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Ben Lickly
    Pt.AcceptedRating:
    Red (blickly)
    Pt.ProposedRating:
    Red (blickly)
    • Method Detail

      • compare

        public abstract int compare​(Concept concept)
                             throws IllegalActionException
        Compare this concept with the given concept. Returns an int value that corresponds to the ordering between the elements as given in the CPO interface.
        Parameters:
        concept - The concept with which we are comparing.
        Returns:
        CPO.HIGHER if this concept is above the given concept, CPO.LOWER if this concept is below the given concept, CPO.SAME if both concepts are the same, and CPO.INCOMPARABLE if concepts are incomparable.
        Throws:
        IllegalActionException - If the specified concept does not have the same ontology as this one.
      • equals

        public boolean equals​(java.lang.Object concept)
        Return if this concept is equal to the given object, which is only the case if compare returns CPO.SAME.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        concept - Object with which to compare.
        Returns:
        True, if both concepts are the same. False, otherwise.
      • getRepresentative

        public InfiniteConceptRepresentative getRepresentative()
        Return the finite concept representative in the ontology if it exists, or null if it does not. Derived classes only need to override this method if they have a representative in the ontology. Some infinite concepts like RecordConcept do not need a representative.
        Returns:
        Return null in the base class.
      • hashCode

        public abstract int hashCode()
        Return a hash code for this Concept.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        A valid hash code.
        See Also:
        Object.hashCode()
      • greatestLowerBound

        public abstract Concept greatestLowerBound​(Concept concept)
                                            throws java.lang.IllegalArgumentException
        Compute the greatest lower bound (GLB) of this and another concept.
        Parameters:
        concept - The other concept
        Returns:
        The concept that is the GLB of this and the given concept.
        Throws:
        java.lang.IllegalArgumentException - If concepts are not drawn from the same ontology.
      • leastUpperBound

        public abstract Concept leastUpperBound​(Concept concept)
                                         throws java.lang.IllegalArgumentException
        Compute the least upper bound (LUB) of this and another concept.
        Parameters:
        concept - The other concept
        Returns:
        The concept that is the LUB of this and the given concept.
        Throws:
        java.lang.IllegalArgumentException - If concepts are not drawn from the same ontology.