Class SetFact<E>

java.lang.Object
pascal.taie.analysis.dataflow.fact.SetFact<E>
Type Parameters:
E - type of elements
All Implemented Interfaces:
Iterable<E>, Copyable<SetFact<E>>

public class SetFact<E> extends Object implements Copyable<SetFact<E>>, Iterable<E>
Represents set-like data-flow facts.
  • Field Details

    • set

      protected final Set<E> set
  • Constructor Details

    • SetFact

      public SetFact(Collection<E> c)
    • SetFact

      public SetFact()
  • Method Details

    • contains

      public boolean contains(E e)
      Returns:
      true if this set contains the specified element, otherwise false.
    • add

      public boolean add(E e)
      Adds an element to this fact.
      Returns:
      true if this fact changed as a result of the call, otherwise false.
    • remove

      public boolean remove(E e)
      Removes an element from this fact.
      Returns:
      true if an element was removed as a result of the call, otherwise false.
    • removeIf

      public boolean removeIf(Predicate<E> filter)
      Removes all the elements of this fact that satisfy the given predicate.
      Returns:
      true if any elements were removed as a result of the call, otherwise false.
    • removeAll

      public boolean removeAll(SetFact<E> other)
      Removes all elements of other fact.
      Returns:
      true if this fact changed as a result of the call, otherwise false.
    • union

      public boolean union(SetFact<E> other)
      Unions other fact into this fact.
      Returns:
      true if this fact changed as a result of the call, otherwise false.
    • unionWith

      public SetFact<E> unionWith(SetFact<E> other)
      Returns:
      a new fact which is the union of this and other facts.
    • intersect

      public boolean intersect(SetFact<E> other)
      Intersects this fact with other fact.
      Returns:
      true if this fact changed as a result of the call, otherwise false.
    • intersectWith

      public SetFact<E> intersectWith(SetFact<E> other)
      Returns:
      a new fact which is the intersection of this and other facts.
    • set

      public void set(SetFact<E> other)
      Sets the content of this set to the same as other set.
    • copy

      public SetFact<E> copy()
      Creates and returns a copy of this fact.
      Specified by:
      copy in interface Copyable<E>
      Returns:
      a copy of this object.
    • clear

      public void clear()
      Clears all content in this fact.
    • isEmpty

      public boolean isEmpty()
    • stream

      public Stream<E> stream()
    • iterator

      public Iterator<E> iterator()
      Specified by:
      iterator in interface Iterable<E>
    • forEach

      public void forEach(Consumer<? super E> action)
      Specified by:
      forEach in interface Iterable<E>
    • size

      public int size()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object