|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.findbugs.ba.LockSet
public class LockSet
Lock counts for values (as produced by ValueNumberAnalysis). A LockSet tells us the lock counts for all values in a method, insofar as we can accurately determine them.
ValueNumberAnalysis
Field Summary | |
---|---|
private int[] |
array
Lock counts are stored in an array. |
static int |
BOTTOM
An invalid lock count resulting from the meet of two different (inconsistent) lock counts. |
private static int |
DEFAULT_CAPACITY
|
private int |
defaultLockCount
The lock count value to return for nonexistent lock entries. |
private static int |
INVALID
|
static int |
TOP
An uninitialized lock value. |
Constructor Summary | |
---|---|
LockSet()
Constructor. |
Method Summary | |
---|---|
private void |
addEntry(int index,
int valueNumber,
int lockCount)
|
void |
clear()
Clear all entries out of this LockSet. |
boolean |
containsReturnValue(ValueNumberFactory factory)
Determine whether or not this lock set contains any locked values which are method return values. |
void |
copyFrom(LockSet other)
Make this LockSet the same as the given one. |
private int |
findIndex(int valueNumber)
|
int |
getLockCount(int valueNumber)
Get the lock count for given lock object. |
int |
getNumLockedObjects()
Get the number of distinct lock values with positive lock counts. |
private boolean |
identicalSubset(LockSet other)
|
void |
intersectWith(LockSet other)
Destructively intersect this lock set with another. |
boolean |
isEmpty()
Return whether or not this lock set is empty, meaning that no locks have a positive lock count. |
void |
meetWith(LockSet other)
Meet this LockSet with another LockSet, storing the result in this object. |
private static int |
mergeValues(int a,
int b)
|
boolean |
sameAs(LockSet other)
Return whether or not this LockSet is the same as the one given. |
void |
setDefaultLockCount(int defaultLockCount)
Set the default lock count to return for nonexistent lock entries. |
void |
setLockCount(int valueNumber,
int lockCount)
Set the lock count for a lock object. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int TOP
public static final int BOTTOM
private static final int INVALID
private static final int DEFAULT_CAPACITY
private int[] array
private int defaultLockCount
Constructor Detail |
---|
public LockSet()
Method Detail |
---|
public int getLockCount(int valueNumber)
valueNumber
- value number of the lock object
public void setLockCount(int valueNumber, int lockCount)
valueNumber
- value number of the lock objectlockCount
- the lock count for the lockpublic void setDefaultLockCount(int defaultLockCount)
defaultLockCount
- the default lock count valuepublic int getNumLockedObjects()
public void copyFrom(LockSet other)
other
- the LockSet to copypublic void clear()
public void meetWith(LockSet other)
other
- the other LockSetpublic boolean sameAs(LockSet other)
other
- the other LockSetpublic boolean containsReturnValue(ValueNumberFactory factory)
factory
- the ValueNumberFactory that produced the lock valuespublic void intersectWith(LockSet other)
other
- the other LockSetpublic boolean isEmpty()
private boolean identicalSubset(LockSet other)
private static int mergeValues(int a, int b)
private int findIndex(int valueNumber)
private void addEntry(int index, int valueNumber, int lockCount)
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |