Class Concept<T extends Supracontext>

  • Type Parameters:
    T - The implementation of Supracontext to be stored in this node.
    All Implemented Interfaces:
    Supracontext

    public class Concept<T extends Supracontext>
    extends java.lang.Object
    implements Supracontext
    This class is a decorator which wraps a Supracontext and adds the functionality of a node (concept) used in the ImprovedAddIntent algorithm (see SparseLattice.
    • Constructor Detail

      • Concept

        public Concept​(Label intent,
                       T extent)
    • Method Detail

      • getExtent

        public java.util.Set<Subcontext> getExtent()
      • getSupra

        public T getSupra()
      • addToExtent

        public void addToExtent​(Subcontext newSub)
        Add the given subcontext to the extent of this concept.
      • getIntent

        public Label getIntent()
      • getParents

        public java.util.Set<Concept<T>> getParents()
      • addParent

        public void addParent​(Concept<T> newParent)
      • removeParent

        public void removeParent​(Concept<T> oldParent)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • copy

        public Supracontext copy()
        Description copied from interface: Supracontext
        Return an exact, deep copy of the supracontext. The new object should be an instance of the same class as the calling object.
        Specified by:
        copy in interface Supracontext
        Returns:
        a deep copy of this supracontext.
      • equals

        public boolean equals​(java.lang.Object other)
        This equals method differs from the specification in Supracontext.equals(Object); it compares the concept intent (label), instead of the extent (contained subcontexts). Two Supracontexts are equal if they are of the same class and contain the same subcontexts.
        Specified by:
        equals in interface Supracontext
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        This implementation differs from the specification in Supracontext.hashCode(); it returns the hash of the intent (label), instead of the extent (contained subcontexts). The hashcode depends solely on the set of subcontexts contained in a supracontext.
        Specified by:
        hashCode in interface Supracontext
        Overrides:
        hashCode in class java.lang.Object
      • getData

        public java.util.Set<Subcontext> getData()
        Specified by:
        getData in interface Supracontext
        Returns:
        an unmodifiable view of the set of subcontexts contained in this supracontext.
      • add

        public void add​(Subcontext sub)
        Description copied from interface: Supracontext
        Add a subcontext to this supracontext.
        Specified by:
        add in interface Supracontext
        Parameters:
        sub - Subcontext to add to the supracontext.
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface Supracontext
        Returns:
        true if this supracontext contains no subcontexts; false otherwise.
      • getCount

        public java.math.BigInteger getCount()
        Specified by:
        getCount in interface Supracontext
        Returns:
        the number of copies of this supracontext contained in the lattice
      • setCount

        public void setCount​(java.math.BigInteger count)
        Description copied from interface: Supracontext
        Set the count of the supracontext.
        Specified by:
        setCount in interface Supracontext
        Parameters:
        count - the count
      • getContext

        public Label getContext()
        Description copied from interface: Supracontext
        Retrieve the supracontextual context, represented with a Label object. Label mismatches should be interpreted as "contained subcontexts may or may not match for this attribute, while matches should be regarded as "all contained subcontexts matched for this attribute". The running time for this default implementation is linear in the number of contained subcontexts.
        Specified by:
        getContext in interface Supracontext
        Returns:
        The context for this supracontext, or null if the subcontexts are empty
      • notTagged

        public boolean notTagged()
      • setTagged

        public void setTagged​(boolean tag)
      • getCandidateParent

        public Concept<T> getCandidateParent()
      • setCandidateParent

        public void setCandidateParent​(Concept<T> candidateParent)