Class BasicSupra

    • Constructor Summary

      Constructors 
      Constructor Description
      BasicSupra()
      Create a new supracontext with an empty data set.
      BasicSupra​(java.util.Set<Subcontext> data, java.math.BigInteger count)
      Creates a new supracontext with the given parameters as the contents.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(Subcontext sub)
      Add a subcontext to this supracontext.
      BasicSupra copy()
      Return an exact, deep copy of the supracontext.
      boolean equals​(java.lang.Object other)
      Two Supracontexts are equal if they are of the same class and contain the same subcontexts.
      Label getContext()
      Retrieve the supracontextual context, represented with a Label object.
      java.math.BigInteger getCount()  
      java.util.Set<Subcontext> getData()  
      int hashCode()
      The hashcode depends solely on the set of subcontexts contained in a supracontext.
      boolean isEmpty()  
      void setCount​(java.math.BigInteger count)
      Set the count of the supracontext.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • BasicSupra

        public BasicSupra()
        Create a new supracontext with an empty data set.
      • BasicSupra

        public BasicSupra​(java.util.Set<Subcontext> data,
                          java.math.BigInteger count)
        Creates a new supracontext with the given parameters as the contents.
        Parameters:
        data - The subcontexts contained in the supracontext
        count - The count of this supracontext
        Throws:
        java.lang.IllegalArgumentException - if data or count are null, or count is less than BigInteger.ZERO
    • Method Detail

      • 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.
      • 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.
      • 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
      • copy

        public BasicSupra 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)
        Description copied from interface: Supracontext
        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()
        Description copied from interface: Supracontext
        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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        String representation of this supracontext in this form: "[" count "x" sub1.toString() "," sub2.toString() ... "]"