Package soot.toolkits.scalar
Class ArraySparseSet<T>
- java.lang.Object
-
- soot.toolkits.scalar.AbstractFlowSet<T>
-
- soot.toolkits.scalar.ArraySparseSet<T>
-
- Direct Known Subclasses:
MonitorSet
public class ArraySparseSet<T> extends AbstractFlowSet<T>
Reference implementation for a FlowSet. Items are stored in an Array.
-
-
Field Summary
Fields Modifier and Type Field Description protected static intDEFAULT_SIZEprotected T[]elementsprotected intmaxElementsprotected intnumElements
-
Constructor Summary
Constructors Constructor Description ArraySparseSet()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidadd(T e)Addsobjtothis.voidclear()implemented, but *very* inefficient.ArraySparseSet<T>clone()Clones the current FlowSet.booleancontains(Object obj)Deprecated.This method uses linear-time lookup.voidcopy(FlowSet<T> destFlow)Copies the current FlowSet into dest.voidcopyFreshToExisting(FlowSet<T> destFlow)Copies a *fresh* copy of this to dest.voiddifference(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.booleanequals(Object otherFlow)voidintersection(FlowSet<T> otherFlow, FlowSet<T> destFlow)Returns the intersection (meet) of this FlowSet andother, putting result intodest.booleanisEmpty()Returns true if this FlowSet is the empty set.Iterator<T>iterator()returns an iterator over the elements of the flowSet.voidremove(int idx)voidremove(Object obj)Removesobjfromthis.intsize()Returns the size of the current FlowSet.List<T>toList()Returns a unbacked list of elements in this set.voidunion(FlowSet<T> otherFlow, FlowSet<T> destFlow)Returns the union (join) of this FlowSet andother, putting result intodest.-
Methods inherited from class soot.toolkits.scalar.AbstractFlowSet
add, difference, hashCode, intersection, isSubSet, remove, toString, union
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
DEFAULT_SIZE
protected static final int DEFAULT_SIZE
- See Also:
- Constant Field Values
-
numElements
protected int numElements
-
maxElements
protected int maxElements
-
elements
protected T[] elements
-
-
Method Detail
-
clone
public ArraySparseSet<T> clone()
Description copied from interface:FlowSetClones the current FlowSet.
-
emptySet
public FlowSet<T> emptySet()
Description copied from class:AbstractFlowSetimplemented, but inefficient.
-
clear
public void clear()
Description copied from class:AbstractFlowSetimplemented, but *very* inefficient.
-
size
public int size()
Description copied from interface:FlowSetReturns the size of the current FlowSet.
-
isEmpty
public boolean isEmpty()
Description copied from interface:FlowSetReturns true if this FlowSet is the empty set.
-
remove
public void remove(Object obj)
Description copied from interface:FlowSetRemovesobjfromthis.
-
remove
public void remove(int idx)
-
union
public void union(FlowSet<T> otherFlow, FlowSet<T> destFlow)
Description copied from interface:FlowSetReturns the union (join) of this FlowSet andother, putting result intodest.dest,otherandthiscould be the same object.
-
intersection
public void intersection(FlowSet<T> otherFlow, FlowSet<T> destFlow)
Description copied from interface:FlowSetReturns the intersection (meet) of this FlowSet andother, putting result intodest.dest,otherandthiscould be the same object.- Specified by:
intersectionin interfaceFlowSet<T>- Overrides:
intersectionin classAbstractFlowSet<T>
-
difference
public void difference(FlowSet<T> otherFlow, FlowSet<T> destFlow)
Description copied from interface:FlowSetReturns the set difference (this intersect ~other) of this FlowSet andother, putting result intodest.dest,otherandthiscould be the same object.- Specified by:
differencein interfaceFlowSet<T>- Overrides:
differencein classAbstractFlowSet<T>
-
contains
@Deprecated public boolean contains(Object obj)
Deprecated.This method uses linear-time lookup. For better performance, consider using aHashSetinstead, if you require this operation.Description copied from interface:FlowSetReturns true if this FlowSet containsobj.
-
equals
public boolean equals(Object otherFlow)
- Overrides:
equalsin classAbstractFlowSet<T>
-
copy
public void copy(FlowSet<T> destFlow)
Description copied from interface:FlowSetCopies the current FlowSet into dest.
-
copyFreshToExisting
public void copyFreshToExisting(FlowSet<T> destFlow)
Description copied from interface:FlowSetCopies a *fresh* copy of this to dest. The input (this) is not referenced somewhere else. This allows subclasses for a smarter and faster copying.
-
-