public class StateSet
extends java.lang.Object
Invariant: no StateSet may contain more than one State with the same ObligationSet.
See Weimer and Necula, Finding and preventing run-time error handling mistakes, OOPSLA 2004.
Constructor and Description |
---|
StateSet(ObligationFactory factory) |
Modifier and Type | Method and Description |
---|---|
void |
addObligation(Obligation obligation,
int basicBlockId)
Add an obligation to every State in the StateSet.
|
void |
clear() |
void |
copyFrom(StateSet other)
Make this StateSet an exact copy of the given StateSet.
|
java.util.Map<ObligationSet,State> |
createEmptyMap()
Return a newly allocated Map of ObligationSet to State that may be passed
to applyToAllStatesAndUpdateMap().
|
void |
deleteObligation(Obligation obligation,
int basicBlockId)
Remove an Obligation from every State in the StateSet.
|
StateSet |
duplicate()
Return an exact deep copy of this StateSet.
|
boolean |
equals(java.lang.Object o) |
java.util.Set<ObligationSet> |
getAllObligationSets()
Get Set of all ObligationsSets in this StateSet.
|
java.util.List<State> |
getPrefixStates(Path path)
Get all States that have Paths which are prefixes of the given Path.
|
State |
getStateWithObligationSet(ObligationSet obligationSet)
Get the State which has the given ObligationSet.
|
int |
hashCode() |
boolean |
isBottom() |
boolean |
isEmpty() |
boolean |
isOnExceptionPath() |
boolean |
isTop() |
boolean |
isValid() |
void |
replaceMap(java.util.Map<ObligationSet,State> stateMap)
Replace the map of ObligationSets to States with the given one.
|
void |
setBottom() |
void |
setOnExceptionPath(boolean onExceptionPath) |
void |
setTop() |
java.util.Iterator<State> |
stateIterator()
Return an Iterator over the States in the StateSet.
|
java.lang.String |
toString() |
public StateSet(ObligationFactory factory)
public boolean isEmpty()
public void setTop()
public boolean isTop()
public void setBottom()
public boolean isBottom()
public boolean isValid()
public boolean isOnExceptionPath()
public void setOnExceptionPath(boolean onExceptionPath)
public void clear()
public java.util.Iterator<State> stateIterator()
public java.util.Set<ObligationSet> getAllObligationSets()
public State getStateWithObligationSet(ObligationSet obligationSet)
obligationSet
- we want to get the State with this ObligationSetpublic void copyFrom(StateSet other)
other
- a StateSet; this StateSet will be made identical to itpublic StateSet duplicate()
public void addObligation(Obligation obligation, int basicBlockId) throws ObligationAcquiredOrReleasedInLoopException
obligation
- the obligation to addbasicBlockId
- the id of the basic block (path component) adding the
obligationObligationAcquiredOrReleasedInLoopException
public void deleteObligation(Obligation obligation, int basicBlockId) throws ObligationAcquiredOrReleasedInLoopException
obligation
- the obligation to removebasicBlockId
- the id of the basic block (path component) removing the
obligationObligationAcquiredOrReleasedInLoopException
public void replaceMap(java.util.Map<ObligationSet,State> stateMap)
stateMap
- enw map of ObligationSets to Statespublic java.util.List<State> getPrefixStates(Path path)
path
- a Pathpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Map<ObligationSet,State> createEmptyMap()
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.