Package soot.toolkits.scalar
Class AbstractFlowSet<T>
- java.lang.Object
-
- soot.toolkits.scalar.AbstractFlowSet<T>
-
- Direct Known Subclasses:
AbstractBoundedFlowSet
,ArraySparseSet
,DavaFlowSet
,HashSparseSet
,ToppedSet
public abstract class AbstractFlowSet<T> extends Object implements FlowSet<T>
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
Constructors Constructor Description AbstractFlowSet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
add(T obj)
Addsobj
tothis
.void
add(T obj, FlowSet<T> dest)
putsthis
unionobj
intodest
.void
clear()
implemented, but *very* inefficient.abstract AbstractFlowSet<T>
clone()
Clones the current FlowSet.abstract boolean
contains(T obj)
Returns true if this FlowSet containsobj
.void
copy(FlowSet<T> dest)
Copies the current FlowSet into dest.void
difference(FlowSet<T> other)
Returns the set difference (this intersect ~other) of this FlowSet andother
, putting result intothis
.void
difference(FlowSet<T> other, FlowSet<T> dest)
Returns the set difference (this intersect ~other) of this FlowSet andother
, putting result intodest
.FlowSet<T>
emptySet()
implemented, but inefficient.boolean
equals(Object o)
int
hashCode()
void
intersection(FlowSet<T> other)
Returns the intersection (meet) of this FlowSet andother
, putting result intothis
.void
intersection(FlowSet<T> other, FlowSet<T> dest)
Returns the intersection (meet) of this FlowSet andother
, putting result intodest
.abstract boolean
isEmpty()
Returns true if this FlowSet is the empty set.boolean
isSubSet(FlowSet<T> other)
Returns true if theother
FlowSet is a subset ofthis
FlowSet.abstract Iterator<T>
iterator()
returns an iterator over the elements of the flowSet.abstract void
remove(T obj)
Removesobj
fromthis
.void
remove(T obj, FlowSet<T> dest)
Putsthis
minusobj
intodest
.abstract int
size()
Returns the size of the current FlowSet.abstract List<T>
toList()
Returns an unbacked list of contained objects for this FlowSet.String
toString()
void
union(FlowSet<T> other)
Returns the union (join) of this FlowSet andother
, putting result intothis
.void
union(FlowSet<T> other, FlowSet<T> dest)
Returns the union (join) of this FlowSet andother
, putting result intodest
.-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface soot.toolkits.scalar.FlowSet
copyFreshToExisting
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
clone
public abstract AbstractFlowSet<T> clone()
Description copied from interface:FlowSet
Clones the current FlowSet.
-
copy
public void copy(FlowSet<T> dest)
Description copied from interface:FlowSet
Copies the current FlowSet into dest.
-
clear
public void clear()
implemented, but *very* inefficient.
-
union
public void union(FlowSet<T> other)
Description copied from interface:FlowSet
Returns the union (join) of this FlowSet andother
, putting result intothis
.
-
union
public void union(FlowSet<T> other, FlowSet<T> dest)
Description copied from interface:FlowSet
Returns the union (join) of this FlowSet andother
, putting result intodest
.dest
,other
andthis
could be the same object.
-
intersection
public void intersection(FlowSet<T> other)
Description copied from interface:FlowSet
Returns the intersection (meet) of this FlowSet andother
, putting result intothis
.- Specified by:
intersection
in interfaceFlowSet<T>
-
intersection
public void intersection(FlowSet<T> other, FlowSet<T> dest)
Description copied from interface:FlowSet
Returns the intersection (meet) of this FlowSet andother
, putting result intodest
.dest
,other
andthis
could be the same object.- Specified by:
intersection
in interfaceFlowSet<T>
-
difference
public void difference(FlowSet<T> other)
Description copied from interface:FlowSet
Returns the set difference (this intersect ~other) of this FlowSet andother
, putting result intothis
.- Specified by:
difference
in interfaceFlowSet<T>
-
difference
public void difference(FlowSet<T> other, FlowSet<T> dest)
Description copied from interface:FlowSet
Returns the set difference (this intersect ~other) of this FlowSet andother
, putting result intodest
.dest
,other
andthis
could be the same object.- Specified by:
difference
in interfaceFlowSet<T>
-
isEmpty
public abstract boolean isEmpty()
Description copied from interface:FlowSet
Returns true if this FlowSet is the empty set.
-
size
public abstract int size()
Description copied from interface:FlowSet
Returns the size of the current FlowSet.
-
add
public void add(T obj, FlowSet<T> dest)
Description copied from interface:FlowSet
putsthis
unionobj
intodest
.
-
remove
public abstract void remove(T obj)
Description copied from interface:FlowSet
Removesobj
fromthis
.
-
remove
public void remove(T obj, FlowSet<T> dest)
Description copied from interface:FlowSet
Putsthis
minusobj
intodest
.
-
isSubSet
public boolean isSubSet(FlowSet<T> other)
Description copied from interface:FlowSet
Returns true if theother
FlowSet is a subset ofthis
FlowSet.
-
contains
public abstract boolean contains(T obj)
Description copied from interface:FlowSet
Returns true if this FlowSet containsobj
.
-
iterator
public abstract 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 doingtoList().iterator()
.
-
toList
public abstract List<T> toList()
Description copied from interface:FlowSet
Returns an unbacked list of contained objects for this FlowSet.
-
-