Package edu.umd.cs.findbugs.ba.interproc
Class ParameterProperty
- java.lang.Object
-
- edu.umd.cs.findbugs.ba.interproc.ParameterProperty
-
public class ParameterProperty extends java.lang.ObjectMethod property recording which parameters are have some property (originally, which were required to be nonnull, now made more generic)- Author:
- David Hovemeyer
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_PARAMSMaximum number of parameters that can be represented by a ParameterProperty.
-
Constructor Summary
Constructors Constructor Description ParameterProperty()Constructor.ParameterProperty(int bits)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyFrom(ParameterProperty other)Make this object the same as the given one.java.util.BitSetgetAsBitSet()java.util.BitSetgetMatchingParameters(java.util.BitSet nullArgSet)Given a bitset of null arguments passed to the method represented by this property, return a bitset indicating which null arguments correspond to an non-null param.intgetParamsWithProperty()Get the non-null param bitset.booleanhasProperty(int param)Return whether or not a parameter might be non-null.voidintersectWith(ParameterProperty targetDerefParamSet)Intersect this set with the given set.booleanisEmpty()Return whether or not the set of non-null parameters is empty.java.lang.Iterable<java.lang.Integer>iterable()voidsetParamsWithProperty(int nonNullParamSet)Set the non-null param bitset.voidsetParamsWithProperty(java.util.BitSet nonNullSet)Set the non-null param set from given BitSet.voidsetParamWithProperty(int param, boolean hasProperty)Set whether or not a parameter might be non-null.java.lang.StringtoString()
-
-
-
Field Detail
-
MAX_PARAMS
public static final int MAX_PARAMS
Maximum number of parameters that can be represented by a ParameterProperty.- See Also:
- Constant Field Values
-
-
Method Detail
-
getParamsWithProperty
public int getParamsWithProperty()
Get the non-null param bitset.- Returns:
- the non-null param bitset
-
iterable
public java.lang.Iterable<java.lang.Integer> iterable()
-
setParamsWithProperty
public void setParamsWithProperty(int nonNullParamSet)
Set the non-null param bitset.- Parameters:
nonNullParamSet- the non-null param bitset
-
setParamsWithProperty
public void setParamsWithProperty(java.util.BitSet nonNullSet)
Set the non-null param set from given BitSet.- Parameters:
nonNullSet- BitSet indicating which parameters are non-null
-
setParamWithProperty
public void setParamWithProperty(int param, boolean hasProperty)Set whether or not a parameter might be non-null.- Parameters:
param- the parameter indexhasProperty- true if the parameter might be non-null, false otherwise
-
hasProperty
public boolean hasProperty(int param)
Return whether or not a parameter might be non-null.- Parameters:
param- the parameter index- Returns:
- true if the parameter might be non-null, false otherwise
-
getMatchingParameters
public java.util.BitSet getMatchingParameters(java.util.BitSet nullArgSet)
Given a bitset of null arguments passed to the method represented by this property, return a bitset indicating which null arguments correspond to an non-null param.- Parameters:
nullArgSet- bitset of null arguments- Returns:
- bitset intersecting null arguments and non-null params
-
getAsBitSet
public java.util.BitSet getAsBitSet()
-
isEmpty
public boolean isEmpty()
Return whether or not the set of non-null parameters is empty.- Returns:
- true if the set is empty, false if it contains at least one parameter
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
intersectWith
public void intersectWith(ParameterProperty targetDerefParamSet)
Intersect this set with the given set. Useful for summarizing the properties of multiple methods.- Parameters:
targetDerefParamSet- another set
-
copyFrom
public void copyFrom(ParameterProperty other)
Make this object the same as the given one.- Parameters:
other- another ParameterNullnessProperty
-
-