Class MarkingSet


  • public class MarkingSet
    extends java.lang.Object
    Packs several markings (short[]) into a single short[], while keeping them sorted for easy comparison. Idea: the marking set first contains the number of shorts of the first marking (1 short), then the first marking, then the number of shorts of the second marking (in 1 short), then the second marking, etc.
    Author:
    sander
    • Constructor Summary

      Constructors 
      Constructor Description
      MarkingSet()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static short[] add​(short[] markingSet, short[] marking)
      Add the marking to the markingSet.
      static short[] addAll​(short[] markingSetA, short[] markingSetB)  
      static boolean contains​(short[] markingSet, short[] marking)  
      static boolean containsFinalMarking​(short[] markingSet, java.lang.Iterable<short[]> finalMarkings)  
      static short[] create​(short[] marking)  
      static MarkingSet.MarkingIterator getMarkings​(short[] markingSet)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MarkingSet

        public MarkingSet()
    • Method Detail

      • create

        public static short[] create​(short[] marking)
      • add

        public static short[] add​(short[] markingSet,
                                  short[] marking)
        Add the marking to the markingSet. If the marking was already in the markingSet, add the weight.
        Parameters:
        markingSet -
        marking -
        Returns:
        the new markingSet, or an updated one.
      • addAll

        public static short[] addAll​(short[] markingSetA,
                                     short[] markingSetB)
      • contains

        public static boolean contains​(short[] markingSet,
                                       short[] marking)
      • containsFinalMarking

        public static boolean containsFinalMarking​(short[] markingSet,
                                                   java.lang.Iterable<short[]> finalMarkings)
        Parameters:
        markingSet -
        finalMarkings -
        Returns:
        whether at least one of the markings in the markingSet is a final marking.