soot.jimple.spark.sets
Class DoublePointsToSet

java.lang.Object
  extended by soot.jimple.spark.sets.PointsToSetInternal
      extended by soot.jimple.spark.sets.DoublePointsToSet
All Implemented Interfaces:
EqualsSupportingPointsToSet, PointsToSet

public class DoublePointsToSet
extends PointsToSetInternal

Implementation of points-to set that holds two sets: one for new elements that have not yet been propagated, and the other for elements that have already been propagated.

Author:
Ondrej Lhotak

Nested Class Summary
 
Nested classes/interfaces inherited from class soot.jimple.spark.sets.PointsToSetInternal
PointsToSetInternal.P2SetVisitorDefaultTrue, PointsToSetInternal.P2SetVisitorInt
 
Field Summary
protected  PointsToSetInternal newSet
           
protected  PointsToSetInternal oldSet
           
 
Fields inherited from class soot.jimple.spark.sets.PointsToSetInternal
type
 
Constructor Summary
DoublePointsToSet(Type type, PAG pag)
           
 
Method Summary
 boolean add(Node n)
          Adds n to this set, returns true if n was not already in this set.
 boolean addAll(PointsToSetInternal other, PointsToSetInternal exclude)
          Adds contents of other into this set, returns true if this set changed.
 boolean contains(Node n)
          Returns true iff the set contains n.
 void flushNew()
          Sets all newly-added nodes to old nodes.
 boolean forall(P2SetVisitor v)
          Calls v's visit method on all nodes in this set.
static P2SetFactory getFactory(P2SetFactory newFactory, P2SetFactory oldFactory)
           
 PointsToSetInternal getNewSet()
          Returns set of newly-added nodes since last call to flushNew.
 PointsToSetInternal getOldSet()
          Returns set of nodes already present before last call to flushNew.
 boolean hasNonEmptyIntersection(PointsToSet other)
          Returns true if this set shares some objects with other.
 boolean isEmpty()
          Returns true if this set contains no run-time objects.
 void mergeWith(PointsToSetInternal other)
          Merges other into this set.
 Set possibleTypes()
          Set of all possible run-time types of objects in the set.
 void unFlushNew()
          Sets all nodes to newly-added nodes.
 
Methods inherited from class soot.jimple.spark.sets.PointsToSetInternal
getBitMask, getType, pointsToSetEquals, pointsToSetHashCode, possibleClassConstants, possibleStringConstants, setType, size, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

newSet

protected PointsToSetInternal newSet

oldSet

protected PointsToSetInternal oldSet
Constructor Detail

DoublePointsToSet

public DoublePointsToSet(Type type,
                         PAG pag)
Method Detail

isEmpty

public boolean isEmpty()
Returns true if this set contains no run-time objects.


hasNonEmptyIntersection

public boolean hasNonEmptyIntersection(PointsToSet other)
Returns true if this set shares some objects with other.

Specified by:
hasNonEmptyIntersection in interface PointsToSet
Overrides:
hasNonEmptyIntersection in class PointsToSetInternal

possibleTypes

public Set possibleTypes()
Set of all possible run-time types of objects in the set.

Specified by:
possibleTypes in interface PointsToSet
Overrides:
possibleTypes in class PointsToSetInternal

addAll

public boolean addAll(PointsToSetInternal other,
                      PointsToSetInternal exclude)
Adds contents of other into this set, returns true if this set changed.

Overrides:
addAll in class PointsToSetInternal

forall

public boolean forall(P2SetVisitor v)
Calls v's visit method on all nodes in this set.

Specified by:
forall in class PointsToSetInternal

add

public boolean add(Node n)
Adds n to this set, returns true if n was not already in this set.

Specified by:
add in class PointsToSetInternal

getOldSet

public PointsToSetInternal getOldSet()
Returns set of nodes already present before last call to flushNew.

Overrides:
getOldSet in class PointsToSetInternal

getNewSet

public PointsToSetInternal getNewSet()
Returns set of newly-added nodes since last call to flushNew.

Overrides:
getNewSet in class PointsToSetInternal

flushNew

public void flushNew()
Sets all newly-added nodes to old nodes.

Overrides:
flushNew in class PointsToSetInternal

unFlushNew

public void unFlushNew()
Sets all nodes to newly-added nodes.

Overrides:
unFlushNew in class PointsToSetInternal

mergeWith

public void mergeWith(PointsToSetInternal other)
Merges other into this set.

Overrides:
mergeWith in class PointsToSetInternal

contains

public boolean contains(Node n)
Returns true iff the set contains n.

Specified by:
contains in class PointsToSetInternal

getFactory

public static P2SetFactory getFactory(P2SetFactory newFactory,
                                      P2SetFactory oldFactory)