Package soot.toolkits.scalar
Class ArrayPackedSet<T>
- java.lang.Object
-
- soot.toolkits.scalar.AbstractFlowSet<T>
-
- soot.toolkits.scalar.AbstractBoundedFlowSet<T>
-
- soot.toolkits.scalar.ArrayPackedSet<T>
-
- All Implemented Interfaces:
Iterable<T>
,BoundedFlowSet<T>
,FlowSet<T>
public class ArrayPackedSet<T> extends AbstractBoundedFlowSet<T>
Reference implementation for a BoundedFlowSet. Items are stored in an Array.
-
-
Field Summary
Fields Modifier and Type Field Description protected BitSet
bits
protected ObjectIntMapper<T>
map
-
Constructor Summary
Constructors Constructor Description ArrayPackedSet(FlowUniverse<T> universe)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(T obj)
Addsobj
tothis
.void
clear()
implemented, but *very* inefficient.ArrayPackedSet<T>
clone()
Clones the current FlowSet.void
complement(FlowSet<T> destFlow)
Complements this BoundedFlowSet, putting the result intodest
.boolean
contains(T obj)
Returns true, if the object is in the set.void
copy(FlowSet<T> destFlow)
Copies the current FlowSet into dest.void
difference(FlowSet<T> otherFlow, FlowSet<T> destFlow)
Returns the set difference (this intersect ~other) of this FlowSet andother
, putting result intodest
.FlowSet<T>
emptySet()
implemented, but inefficient.boolean
equals(Object otherFlow)
void
intersection(FlowSet<T> otherFlow, FlowSet<T> destFlow)
Returns the intersection (meet) of this FlowSet andother
, putting result intodest
.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.Iterator<T>
iterator()
returns an iterator over the elements of the flowSet.void
remove(T obj)
Removesobj
fromthis
.int
size()
Returns the size of the current FlowSet.List<T>
toList()
Returns an unbacked list of contained objects for this FlowSet.List<T>
toList(int lowInclusive, int highInclusive)
void
union(FlowSet<T> otherFlow, FlowSet<T> destFlow)
Returns the union (join) of this FlowSet andother
, putting result intodest
.-
Methods inherited from class soot.toolkits.scalar.AbstractBoundedFlowSet
complement, topSet
-
Methods inherited from class soot.toolkits.scalar.AbstractFlowSet
add, difference, hashCode, intersection, remove, toString, union
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface soot.toolkits.scalar.FlowSet
add, copyFreshToExisting, difference, intersection, remove, union
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
map
protected final ObjectIntMapper<T> map
-
bits
protected final BitSet bits
-
-
Constructor Detail
-
ArrayPackedSet
public ArrayPackedSet(FlowUniverse<T> universe)
-
-
Method Detail
-
clone
public ArrayPackedSet<T> clone()
Description copied from interface:FlowSet
Clones the current FlowSet.
-
emptySet
public FlowSet<T> emptySet()
Description copied from class:AbstractFlowSet
implemented, but inefficient.
-
size
public int size()
Description copied from interface:FlowSet
Returns the size of the current FlowSet.
-
isEmpty
public boolean isEmpty()
Description copied from interface:FlowSet
Returns true if this FlowSet is the empty set.
-
clear
public void clear()
Description copied from class:AbstractFlowSet
implemented, but *very* inefficient.
-
toList
public List<T> toList()
Description copied from interface:FlowSet
Returns an unbacked list of contained objects for this FlowSet.
-
complement
public void complement(FlowSet<T> destFlow)
Description copied from interface:BoundedFlowSet
Complements this BoundedFlowSet, putting the result intodest
.dest
andthis
may be the same object.- Specified by:
complement
in interfaceBoundedFlowSet<T>
- Overrides:
complement
in classAbstractBoundedFlowSet<T>
-
isSubSet
public boolean isSubSet(FlowSet<T> other)
Description copied from interface:FlowSet
Returns true if theother
FlowSet is a subset ofthis
FlowSet.
-
union
public void union(FlowSet<T> otherFlow, FlowSet<T> destFlow)
Description copied from interface:FlowSet
Returns the union (join) of this FlowSet andother
, putting result intodest
.dest
,other
andthis
could be the same object.
-
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 andother
, putting result intodest
.dest
,other
andthis
could be the same object.- Specified by:
difference
in interfaceFlowSet<T>
- Overrides:
difference
in classAbstractFlowSet<T>
-
intersection
public void intersection(FlowSet<T> otherFlow, FlowSet<T> destFlow)
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>
- Overrides:
intersection
in classAbstractFlowSet<T>
-
contains
public boolean contains(T obj)
Returns true, if the object is in the set.
-
equals
public boolean equals(Object otherFlow)
- Overrides:
equals
in classAbstractFlowSet<T>
-
copy
public void copy(FlowSet<T> destFlow)
Description copied from interface:FlowSet
Copies the current FlowSet into dest.
-
-