Class CTMarking

  • All Implemented Interfaces:
    java.lang.Comparable<Marking>, java.lang.Iterable<Place>, java.util.Collection<Place>, org.processmining.framework.util.collection.MultiSet<Place>, org.processmining.framework.util.collection.SortedMultiSet<Place>, org.processmining.framework.util.HTMLToString

    public class CTMarking
    extends Marking
    This class represent a Marking with an addition of omega pointer. Omega is a place which has unlimited token. The class is used to represent a coverability graph.
    Version:
    1 September 2008
    Author:
    arya
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.processmining.framework.util.HTMLToString

        org.processmining.framework.util.HTMLToString.HTMLCellRenderer
    • Field Summary

      • Fields inherited from class org.processmining.framework.util.collection.AbstractMultiSet

        map, size
    • Constructor Summary

      Constructors 
      Constructor Description
      CTMarking()
      Default constructor
      CTMarking​(java.util.Collection<Place> collection)
      Constructor with collection parameter
      CTMarking​(CTMarking collection)
      Constructor with marking parameter
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean addOmegaPlace​(Place p)
      Add a place which should be presented with omega
      boolean equals​(java.lang.Object o)
      returns true if the multisets are equal, i.e.
      java.util.Set<Place> getOmegaPlaces()
      Get a set of omega places
      boolean hasOmegaPlace()
      Return true if the CTMarking has omega place
      boolean isLessOrEqual​(org.processmining.framework.util.collection.MultiSet<Place> multiSet)
      returns true if this multiset is less or equal to the given multiset, i.e.
      Marking minus​(CTMarking m)
      removes the elements in the given multiset from this multiset and returns a multiset indicating what was removed.
      boolean remove​(java.lang.Object o)
      removes the given object from this multiset, if it is in there.
      protected <S extends org.processmining.framework.util.collection.MultiSet<Place>>
      S
      removeAllMultiSet​(org.processmining.framework.util.collection.AbstractMultiSet<?,​?> mset, S removed)  
      boolean removeOmegaPlace​(Place removedItem)
      Remove a place from the list of omega places
      boolean retainAll​(CTMarking c)
      Keeps all elements of the given collection in this multiset.
      java.lang.String toHTMLString​(boolean includeHTMLTags)  
      java.lang.String toString()
      New toString, to represent elements of inifinite occurrence with "w"
      CTMarking transformToOmega​(java.util.Collection<Place> reference)
      transform all places in this CTMarking into omega.
      • Methods inherited from class org.processmining.framework.util.collection.TreeMultiSet

        baseSet, comparator
      • Methods inherited from class org.processmining.framework.util.collection.AbstractMultiSet

        add, add, addAll, clear, contains, containsAll, containsAtLeast, hashCode, isEmpty, iterator, occurrences, removeAll, retainAll, retainAll, size, toList
      • Methods inherited from class java.util.AbstractCollection

        toArray, toArray
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        add, addAll, clear, contains, containsAll, hashCode, isEmpty, iterator, parallelStream, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface org.processmining.framework.util.collection.MultiSet

        add, occurrences, toList
    • Constructor Detail

      • CTMarking

        public CTMarking​(CTMarking collection)
        Constructor with marking parameter
        Parameters:
        collection -
      • CTMarking

        public CTMarking​(java.util.Collection<Place> collection)
        Constructor with collection parameter
        Parameters:
        collection -
      • CTMarking

        public CTMarking()
        Default constructor
    • Method Detail

      • hasOmegaPlace

        public boolean hasOmegaPlace()
        Return true if the CTMarking has omega place
        Returns:
      • retainAll

        public boolean retainAll​(CTMarking c)
        Keeps all elements of the given collection in this multiset. Multiplicities are taken into account.
        Returns:
        true if the CTMarking changed from calling this method.
      • addOmegaPlace

        public boolean addOmegaPlace​(Place p)
        Add a place which should be presented with omega
        Parameters:
        p - place which should be presented with omega
        Returns:
        true if the place added successfully
      • removeOmegaPlace

        public boolean removeOmegaPlace​(Place removedItem)
        Remove a place from the list of omega places
        Parameters:
        removedItem -
        Returns:
        true if the place is successfully removed from the list of omega places
      • getOmegaPlaces

        public java.util.Set<Place> getOmegaPlaces()
        Get a set of omega places
        Returns:
      • equals

        public boolean equals​(java.lang.Object o)
        Description copied from class: org.processmining.framework.util.collection.AbstractMultiSet
        returns true if the multisets are equal, i.e. if they contain the same objects with the same number of occurrences.
        Specified by:
        equals in interface java.util.Collection<Place>
        Overrides:
        equals in class Marking
      • transformToOmega

        public CTMarking transformToOmega​(java.util.Collection<Place> reference)
        transform all places in this CTMarking into omega. Omega is represented as a place CTMarking.OMEGA in place, and also listed as an item in arraylist omegaPlace
        Parameters:
        reference -
        Returns:
      • toString

        public java.lang.String toString()
        New toString, to represent elements of inifinite occurrence with "w"
        Overrides:
        toString in class org.processmining.framework.util.collection.AbstractMultiSet<Place,​java.util.TreeMap<Place,​java.lang.Integer>>
      • toHTMLString

        public java.lang.String toHTMLString​(boolean includeHTMLTags)
        Specified by:
        toHTMLString in interface org.processmining.framework.util.HTMLToString
        Overrides:
        toHTMLString in class org.processmining.framework.util.collection.AbstractMultiSet<Place,​java.util.TreeMap<Place,​java.lang.Integer>>
      • isLessOrEqual

        public boolean isLessOrEqual​(org.processmining.framework.util.collection.MultiSet<Place> multiSet)
        returns true if this multiset is less or equal to the given multiset, i.e. all objects in this multiset should be contained in the given set and the number of occurrences in the given set is at least the number of occurrences in this multiset.
        Specified by:
        isLessOrEqual in interface org.processmining.framework.util.collection.MultiSet<Place>
        Overrides:
        isLessOrEqual in class org.processmining.framework.util.collection.AbstractMultiSet<Place,​java.util.TreeMap<Place,​java.lang.Integer>>
        Parameters:
        multiSet - the multiset to test
        Returns:
        true if the given multiset is less or equal.
      • remove

        public boolean remove​(java.lang.Object o)
        removes the given object from this multiset, if it is in there. Only one occurrence is removed, i.e. contains(o) can still be true after calling remove(o)
        Specified by:
        remove in interface java.util.Collection<Place>
        Overrides:
        remove in class org.processmining.framework.util.collection.AbstractMultiSet<Place,​java.util.TreeMap<Place,​java.lang.Integer>>
      • removeAllMultiSet

        protected <S extends org.processmining.framework.util.collection.MultiSet<Place>> S removeAllMultiSet​(org.processmining.framework.util.collection.AbstractMultiSet<?,​?> mset,
                                                                                                              S removed)
        Overrides:
        removeAllMultiSet in class org.processmining.framework.util.collection.AbstractMultiSet<Place,​java.util.TreeMap<Place,​java.lang.Integer>>
      • minus

        public Marking minus​(CTMarking m)
        removes the elements in the given multiset from this multiset and returns a multiset indicating what was removed.
        Parameters:
        mset - the multiset of elements needing to be removed.
        Returns:
        a new multiset where the occurrences are the occurrences in this multiset, minus the occurrences in the given multiset