edu.umd.cs.findbugs.ba.npe
Class ParameterNullnessProperty

java.lang.Object
  extended by edu.umd.cs.findbugs.ba.npe.ParameterNullnessProperty

public class ParameterNullnessProperty
extends java.lang.Object

Method property recording which parameters are (or should be) non-null, meaning that null values should be passed as their arguments.

Author:
David Hovemeyer

Constructor Summary
ParameterNullnessProperty()
          Constructor.
 
Method Summary
 java.util.BitSet getViolatedParamSet(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.
 boolean isEmpty()
          Return whether or not the set of non-null parameters is empty.
 boolean isNonNull(int param)
          Return whether or not a parameter might be non-null.
 void setNonNull(int param, boolean nonNull)
          Set whether or not a parameter might be non-null.
 void setNonNullParamSet(java.util.BitSet nonNullSet)
          Set the non-null param set from given BitSet.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParameterNullnessProperty

public ParameterNullnessProperty()
Constructor. Parameters are all assumed not to be non-null.

Method Detail

setNonNullParamSet

public void setNonNullParamSet(java.util.BitSet nonNullSet)
Set the non-null param set from given BitSet.

Parameters:
nonNullSet - BitSet indicating which parameters are non-null

setNonNull

public void setNonNull(int param,
                       boolean nonNull)
Set whether or not a parameter might be non-null.

Parameters:
param - the parameter index
nonNull - true if the parameter might be non-null, false otherwise

isNonNull

public boolean isNonNull(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

getViolatedParamSet

public java.util.BitSet getViolatedParamSet(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

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:
toString in class java.lang.Object