soot.toolkits.scalar
Class AbstractFlowSet

java.lang.Object
  extended by soot.toolkits.scalar.AbstractFlowSet
All Implemented Interfaces:
Iterable, FlowSet
Direct Known Subclasses:
AbstractBoundedFlowSet, ArraySparseSet, DavaFlowSet, ToppedSet

public abstract class AbstractFlowSet
extends Object
implements FlowSet, Iterable

provides functional code for most of the methods. Subclasses are invited to provide a more efficient version. Most often this will be done in the following way:

 public void yyy(FlowSet dest) {
   if (dest instanceof xxx) {
     blahblah;
   } else
     super.yyy(dest)
 }
 


Constructor Summary
AbstractFlowSet()
           
 
Method Summary
abstract  void add(Object obj)
          Adds obj to this.
 void add(Object obj, FlowSet dest)
          puts this union obj into dest.
 void clear()
          implemented, but *very* inefficient.
abstract  AbstractFlowSet clone()
          Clones the current FlowSet.
abstract  boolean contains(Object obj)
          Returns true if this FlowSet contains obj.
 void copy(FlowSet dest)
          Copies the current FlowSet into dest.
 void difference(FlowSet other)
          Returns the set difference (this intersect ~other) of this FlowSet and other, putting result into this.
 void difference(FlowSet other, FlowSet dest)
          Returns the set difference (this intersect ~other) of this FlowSet and other, putting result into dest.
 Object emptySet()
          implemented, but inefficient.
 boolean equals(Object o)
           
 int hashCode()
           
 void intersection(FlowSet other)
          Returns the intersection (meet) of this FlowSet and other, putting result into this.
 void intersection(FlowSet other, FlowSet dest)
          Returns the intersection (meet) of this FlowSet and other, putting result into dest.
abstract  boolean isEmpty()
          Returns true if this FlowSet is the empty set.
 Iterator iterator()
          returns an iterator over the elements of the flowSet.
abstract  void remove(Object obj)
          Removes obj from this.
 void remove(Object obj, FlowSet dest)
          Puts this minus obj into dest.
abstract  int size()
          Returns the size of the current FlowSet.
abstract  List toList()
          Returns an unbacked list of contained objects for this FlowSet.
 String toString()
           
 void union(FlowSet other)
          Returns the union (join) of this FlowSet and other, putting result into this.
 void union(FlowSet other, FlowSet dest)
          Returns the union (join) of this FlowSet and other, putting result into dest.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractFlowSet

public AbstractFlowSet()
Method Detail

clone

public abstract AbstractFlowSet clone()
Description copied from interface: FlowSet
Clones the current FlowSet.

Specified by:
clone in interface FlowSet
Overrides:
clone in class Object

emptySet

public Object emptySet()
implemented, but inefficient.

Specified by:
emptySet in interface FlowSet

copy

public void copy(FlowSet dest)
Description copied from interface: FlowSet
Copies the current FlowSet into dest.

Specified by:
copy in interface FlowSet

clear

public void clear()
implemented, but *very* inefficient.

Specified by:
clear in interface FlowSet

union

public void union(FlowSet other)
Description copied from interface: FlowSet
Returns the union (join) of this FlowSet and other, putting result into this.

Specified by:
union in interface FlowSet

union

public void union(FlowSet other,
                  FlowSet dest)
Description copied from interface: FlowSet
Returns the union (join) of this FlowSet and other, putting result into dest. dest, other and this could be the same object.

Specified by:
union in interface FlowSet

intersection

public void intersection(FlowSet other)
Description copied from interface: FlowSet
Returns the intersection (meet) of this FlowSet and other, putting result into this.

Specified by:
intersection in interface FlowSet

intersection

public void intersection(FlowSet other,
                         FlowSet dest)
Description copied from interface: FlowSet
Returns the intersection (meet) of this FlowSet and other, putting result into dest. dest, other and this could be the same object.

Specified by:
intersection in interface FlowSet

difference

public void difference(FlowSet other)
Description copied from interface: FlowSet
Returns the set difference (this intersect ~other) of this FlowSet and other, putting result into this.

Specified by:
difference in interface FlowSet

difference

public void difference(FlowSet other,
                       FlowSet dest)
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

isEmpty

public abstract boolean isEmpty()
Description copied from interface: FlowSet
Returns true if this FlowSet is the empty set.

Specified by:
isEmpty in interface FlowSet

size

public abstract int size()
Description copied from interface: FlowSet
Returns the size of the current FlowSet.

Specified by:
size in interface FlowSet

add

public abstract void add(Object obj)
Description copied from interface: FlowSet
Adds obj to this.

Specified by:
add in interface FlowSet

add

public void add(Object obj,
                FlowSet dest)
Description copied from interface: FlowSet
puts this union obj into dest.

Specified by:
add in interface FlowSet

remove

public abstract void remove(Object obj)
Description copied from interface: FlowSet
Removes obj from this.

Specified by:
remove in interface FlowSet

remove

public void remove(Object obj,
                   FlowSet dest)
Description copied from interface: FlowSet
Puts this minus obj into dest.

Specified by:
remove in interface FlowSet

contains

public abstract boolean contains(Object obj)
Description copied from interface: FlowSet
Returns true if this FlowSet contains obj.

Specified by:
contains in interface FlowSet

iterator

public Iterator 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 Iterable
Specified by:
iterator in interface FlowSet

toList

public abstract List toList()
Description copied from interface: FlowSet
Returns an unbacked list of contained objects for this FlowSet.

Specified by:
toList in interface FlowSet

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