Class DavaFlowSet<T>

    • Field Detail

      • elements

        protected T[] elements
    • Constructor Detail

      • DavaFlowSet

        public DavaFlowSet()
    • Method Detail

      • size

        public int size()
        Description copied from interface: FlowSet
        Returns the size of the current FlowSet.
        Specified by:
        size in interface FlowSet<T>
        Specified by:
        size in class AbstractFlowSet<T>
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: FlowSet
        Returns true if this FlowSet is the empty set.
        Specified by:
        isEmpty in interface FlowSet<T>
        Specified by:
        isEmpty in class AbstractFlowSet<T>
      • remove

        public void remove​(int idx)
      • union

        public void union​(FlowSet<T> otherFlow,
                          FlowSet<T> destFlow)
        Notice that the union method only merges the elements of the flow set DavaFlowSet also contains information regarding abrupt control flow This should also be merged using the copyInternalDataFrom method
        Specified by:
        union in interface FlowSet<T>
        Overrides:
        union in class AbstractFlowSet<T>
      • intersection

        public void intersection​(FlowSet<T> otherFlow,
                                 FlowSet<T> destFlow)
        Notice that the intersection method only merges the elements of the flow set DavaFlowSet also contains information regarding abrupt control flow This should also be merged using the copyInternalDataFrom method
        Specified by:
        intersection in interface FlowSet<T>
        Overrides:
        intersection in class AbstractFlowSet<T>
      • difference

        public void difference​(FlowSet<T> otherFlow,
                               FlowSet<T> destFlow)
        Description copied from interface: FlowSet
        Returns the set difference (this intersect ~other) of this FlowSet and other, putting result into dest. dest, other and this could be the same object.
        Specified by:
        difference in interface FlowSet<T>
        Overrides:
        difference in class AbstractFlowSet<T>
      • equals

        public boolean equals​(Object otherFlow)
        Notice that the equals method only checks the equality of the elements of the flow set DavaFlowSet also contains information regarding abrupt control flow This should also be checked by invoking the internalDataMatchesTo method
        Overrides:
        equals in class AbstractFlowSet<T>
      • addToBreakList

        public void addToBreakList​(String labelBroken,
                                   DavaFlowSet<T> set)
        When an explicit break statement is encountered this method should be called to store the current davaflowset
      • addToContinueList

        public void addToContinueList​(String labelContinued,
                                      DavaFlowSet<T> set)
        When an explicit continue statement is encountered this method should be called to store the current davaflowset
      • addToImplicitBreaks

        public void addToImplicitBreaks​(DAbruptStmt ab,
                                        DavaFlowSet<T> set)
        The next two methods take an abruptStmt as input along with a flowSet. It should be only invoked for abrupt stmts which do not have explicit labels The node being targeted by this implicit stmt should be found Then the flow set should be added to the list within the appropriate hashmap
      • copyInternalDataFrom

        public void copyInternalDataFrom​(DavaFlowSet<T> fromThis)
      • internalDataMatchesTo

        public boolean internalDataMatchesTo​(Object otherObj)
      • iterator

        public Iterator<T> iterator()
        Description copied from interface: FlowSet
        returns an iterator over the elements of the flowSet. Note that the iterator might be backed, and hence be faster in the creation, than doing toList().iterator().
        Specified by:
        iterator in interface FlowSet<T>
        Specified by:
        iterator in interface Iterable<T>
        Specified by:
        iterator in class AbstractFlowSet<T>
      • getElementCount

        public int getElementCount()
      • getElementAt

        public T getElementAt​(int idx)